diff --git a/components/engine/daemon/logger/gcplogs/gcplogging.go b/components/engine/daemon/logger/gcplogs/gcplogging.go index 9a8c1c903f..cbf0a64462 100644 --- a/components/engine/daemon/logger/gcplogs/gcplogging.go +++ b/components/engine/daemon/logger/gcplogs/gcplogging.go @@ -8,10 +8,10 @@ import ( "github.com/docker/docker/daemon/logger" + "cloud.google.com/go/compute/metadata" + "cloud.google.com/go/logging" "github.com/Sirupsen/logrus" "golang.org/x/net/context" - "google.golang.org/cloud/compute/metadata" - "google.golang.org/cloud/logging" ) const ( @@ -51,7 +51,7 @@ func init() { } type gcplogs struct { - client *logging.Client + logger *logging.Logger instance *instanceInfo container *containerInfo } @@ -114,17 +114,18 @@ func New(ctx logger.Context) (logger.Logger, error) { return nil, fmt.Errorf("No project was specified and couldn't read project from the meatadata server. Please specify a project") } - c, err := logging.NewClient(context.Background(), project, "gcplogs-docker-driver") + c, err := logging.NewClient(context.Background(), project) if err != nil { return nil, err } + lg := c.Logger("gcplogs-docker-driver") - if err := c.Ping(); err != nil { + if err := c.Ping(context.Background()); err != nil { return nil, fmt.Errorf("unable to connect or authenticate with Google Cloud Logging: %v", err) } l := &gcplogs{ - client: c, + logger: lg, container: &containerInfo{ Name: ctx.ContainerName, ID: ctx.ContainerID, @@ -157,11 +158,14 @@ func New(ctx logger.Context) (logger.Logger, error) { // overflow func is called. We want to surface the error to the user // without overly spamming /var/log/docker.log so we log the first time // we overflow and every 1000th time after. - c.Overflow = func(_ *logging.Client, _ logging.Entry) error { - if i := atomic.AddUint64(&droppedLogs, 1); i%1000 == 1 { - logrus.Errorf("gcplogs driver has dropped %v logs", i) + c.OnError = func(err error) { + if err == logging.ErrOverflow { + if i := atomic.AddUint64(&droppedLogs, 1); i%1000 == 1 { + logrus.Errorf("gcplogs driver has dropped %v logs", i) + } + } else { + logrus.Error(err) } - return nil } return l, nil @@ -181,18 +185,20 @@ func ValidateLogOpts(cfg map[string]string) error { } func (l *gcplogs) Log(m *logger.Message) error { - return l.client.Log(logging.Entry{ - Time: m.Timestamp, + l.logger.Log(logging.Entry{ + Timestamp: m.Timestamp, Payload: &dockerLogEntry{ Instance: l.instance, Container: l.container, Data: string(m.Line), }, }) + return nil } func (l *gcplogs) Close() error { - return l.client.Flush() + l.logger.Flush() + return nil } func (l *gcplogs) Name() string { diff --git a/components/engine/vendor.conf b/components/engine/vendor.conf index 570200bc49..1ef4bba894 100644 --- a/components/engine/vendor.conf +++ b/components/engine/vendor.conf @@ -88,9 +88,11 @@ github.com/jmespath/go-jmespath 0b12d6b521d83fc7f755e7cfc1b1fbdd35a01a74 github.com/bsphere/le_go d3308aafe090956bc89a65f0769f58251a1b4f03 # gcplogs deps -golang.org/x/oauth2 2baa8a1b9338cf13d9eeb27696d761155fa480be -google.golang.org/api dc6d2353af16e2a2b0ff6986af051d473a4ed468 -google.golang.org/cloud dae7e3d993bc3812a2185af60552bb6b847e52a0 +golang.org/x/oauth2 96382aa079b72d8c014eb0c50f6c223d1e6a2de0 +google.golang.org/api 3cc2e591b550923a2c5f0ab5a803feda924d5823 +cloud.google.com/go 9d965e63e8cceb1b5d7977a202f0fcb8866d6525 +github.com/googleapis/gax-go da06d194a00e19ce00d9011a13931c3f6f6887c7 +google.golang.org/genproto 9359a8d303c45e3212571b77610f1cefb0c6f3eb # native credentials github.com/docker/docker-credential-helpers f72c04f1d8e71959a6d103f808c50ccbad79b9fd diff --git a/components/engine/vendor/google.golang.org/cloud/LICENSE b/components/engine/vendor/cloud.google.com/go/LICENSE similarity index 100% rename from components/engine/vendor/google.golang.org/cloud/LICENSE rename to components/engine/vendor/cloud.google.com/go/LICENSE diff --git a/components/engine/vendor/google.golang.org/cloud/compute/metadata/metadata.go b/components/engine/vendor/cloud.google.com/go/compute/metadata/metadata.go similarity index 66% rename from components/engine/vendor/google.golang.org/cloud/compute/metadata/metadata.go rename to components/engine/vendor/cloud.google.com/go/compute/metadata/metadata.go index 972972dd76..f9d2bef6c2 100644 --- a/components/engine/vendor/google.golang.org/cloud/compute/metadata/metadata.go +++ b/components/engine/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -17,7 +17,7 @@ // // This package is a wrapper around the GCE metadata service, // as documented at https://developers.google.com/compute/docs/metadata. -package metadata // import "google.golang.org/cloud/compute/metadata" +package metadata // import "cloud.google.com/go/compute/metadata" import ( "encoding/json" @@ -27,11 +27,27 @@ import ( "net/http" "net/url" "os" + "runtime" "strings" "sync" "time" - "google.golang.org/cloud/internal" + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" + + "cloud.google.com/go/internal" +) + +const ( + // metadataIP is the documented metadata server IP address. + metadataIP = "169.254.169.254" + + // metadataHostEnv is the environment variable specifying the + // GCE metadata hostname. If empty, the default value of + // metadataIP ("169.254.169.254") is used instead. + // This is variable name is not defined by any spec, as far as + // I know; it was made up for the Go package. + metadataHostEnv = "GCE_METADATA_HOST" ) type cachedValue struct { @@ -47,17 +63,29 @@ var ( instID = &cachedValue{k: "instance/id", trim: true} ) -var metaClient = &http.Client{ - Transport: &internal.Transport{ - Base: &http.Transport{ - Dial: (&net.Dialer{ - Timeout: 750 * time.Millisecond, - KeepAlive: 30 * time.Second, - }).Dial, - ResponseHeaderTimeout: 750 * time.Millisecond, +var ( + metaClient = &http.Client{ + Transport: &internal.Transport{ + Base: &http.Transport{ + Dial: (&net.Dialer{ + Timeout: 2 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + ResponseHeaderTimeout: 2 * time.Second, + }, }, - }, -} + } + subscribeClient = &http.Client{ + Transport: &internal.Transport{ + Base: &http.Transport{ + Dial: (&net.Dialer{ + Timeout: 2 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + }, + }, + } +) // NotDefinedError is returned when requested metadata is not defined. // @@ -80,31 +108,31 @@ func (suffix NotDefinedError) Error() string { // If the requested metadata is not defined, the returned error will // be of type NotDefinedError. func Get(suffix string) (string, error) { - val, _, err := getETag(suffix) + val, _, err := getETag(metaClient, suffix) return val, err } // getETag returns a value from the metadata service as well as the associated -// ETag. This func is otherwise equivalent to Get. -func getETag(suffix string) (value, etag string, err error) { +// ETag using the provided client. This func is otherwise equivalent to Get. +func getETag(client *http.Client, suffix string) (value, etag string, err error) { // Using a fixed IP makes it very difficult to spoof the metadata service in // a container, which is an important use-case for local testing of cloud // deployments. To enable spoofing of the metadata service, the environment // variable GCE_METADATA_HOST is first inspected to decide where metadata // requests shall go. - host := os.Getenv("GCE_METADATA_HOST") + host := os.Getenv(metadataHostEnv) if host == "" { // Using 169.254.169.254 instead of "metadata" here because Go // binaries built with the "netgo" tag and without cgo won't // know the search suffix for "metadata" is // ".google.internal", and this IP address is documented as // being stable anyway. - host = "169.254.169.254" + host = metadataIP } url := "http://" + host + "/computeMetadata/v1/" + suffix req, _ := http.NewRequest("GET", url, nil) req.Header.Set("Metadata-Flavor", "Google") - res, err := metaClient.Do(req) + res, err := client.Do(req) if err != nil { return "", "", err } @@ -145,33 +173,103 @@ func (c *cachedValue) get() (v string, err error) { return } -var onGCE struct { - sync.Mutex - set bool - v bool -} +var ( + onGCEOnce sync.Once + onGCE bool +) // OnGCE reports whether this process is running on Google Compute Engine. func OnGCE() bool { - defer onGCE.Unlock() - onGCE.Lock() - if onGCE.set { - return onGCE.v - } - onGCE.set = true + onGCEOnce.Do(initOnGCE) + return onGCE +} - // We use the DNS name of the metadata service here instead of the IP address - // because we expect that to fail faster in the not-on-GCE case. - res, err := metaClient.Get("http://metadata.google.internal") - if err != nil { +func initOnGCE() { + onGCE = testOnGCE() +} + +func testOnGCE() bool { + // The user explicitly said they're on GCE, so trust them. + if os.Getenv(metadataHostEnv) != "" { + return true + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + resc := make(chan bool, 2) + + // Try two strategies in parallel. + // See https://github.com/GoogleCloudPlatform/google-cloud-go/issues/194 + go func() { + res, err := ctxhttp.Get(ctx, metaClient, "http://"+metadataIP) + if err != nil { + resc <- false + return + } + defer res.Body.Close() + resc <- res.Header.Get("Metadata-Flavor") == "Google" + }() + + go func() { + addrs, err := net.LookupHost("metadata.google.internal") + if err != nil || len(addrs) == 0 { + resc <- false + return + } + resc <- strsContains(addrs, metadataIP) + }() + + tryHarder := systemInfoSuggestsGCE() + if tryHarder { + res := <-resc + if res { + // The first strategy succeeded, so let's use it. + return true + } + // Wait for either the DNS or metadata server probe to + // contradict the other one and say we are running on + // GCE. Give it a lot of time to do so, since the system + // info already suggests we're running on a GCE BIOS. + timer := time.NewTimer(5 * time.Second) + defer timer.Stop() + select { + case res = <-resc: + return res + case <-timer.C: + // Too slow. Who knows what this system is. + return false + } + } + + // There's no hint from the system info that we're running on + // GCE, so use the first probe's result as truth, whether it's + // true or false. The goal here is to optimize for speed for + // users who are NOT running on GCE. We can't assume that + // either a DNS lookup or an HTTP request to a blackholed IP + // address is fast. Worst case this should return when the + // metaClient's Transport.ResponseHeaderTimeout or + // Transport.Dial.Timeout fires (in two seconds). + return <-resc +} + +// systemInfoSuggestsGCE reports whether the local system (without +// doing network requests) suggests that we're running on GCE. If this +// returns true, testOnGCE tries a bit harder to reach its metadata +// server. +func systemInfoSuggestsGCE() bool { + if runtime.GOOS != "linux" { + // We don't have any non-Linux clues available, at least yet. return false } - onGCE.v = res.Header.Get("Metadata-Flavor") == "Google" - return onGCE.v + slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") + name := strings.TrimSpace(string(slurp)) + return name == "Google" || name == "Google Compute Engine" } // Subscribe subscribes to a value from the metadata service. // The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". +// The suffix may contain query parameters. // // Subscribe calls fn with the latest metadata value indicated by the provided // suffix. If the metadata value is deleted, fn is called with the empty string @@ -182,7 +280,7 @@ func Subscribe(suffix string, fn func(v string, ok bool) error) error { const failedSubscribeSleep = time.Second * 5 // First check to see if the metadata value exists at all. - val, lastETag, err := getETag(suffix) + val, lastETag, err := getETag(subscribeClient, suffix) if err != nil { return err } @@ -192,9 +290,13 @@ func Subscribe(suffix string, fn func(v string, ok bool) error) error { } ok := true - suffix += "?wait_for_change=true&last_etag=" + if strings.ContainsRune(suffix, '?') { + suffix += "&wait_for_change=true&last_etag=" + } else { + suffix += "?wait_for_change=true&last_etag=" + } for { - val, etag, err := getETag(suffix + url.QueryEscape(lastETag)) + val, etag, err := getETag(subscribeClient, suffix+url.QueryEscape(lastETag)) if err != nil { if _, deleted := err.(NotDefinedError); !deleted { time.Sleep(failedSubscribeSleep) @@ -325,3 +427,12 @@ func Scopes(serviceAccount string) ([]string, error) { } return lines("instance/service-accounts/" + serviceAccount + "/scopes") } + +func strsContains(ss []string, s string) bool { + for _, v := range ss { + if v == s { + return true + } + } + return false +} diff --git a/components/engine/vendor/cloud.google.com/go/internal/cloud.go b/components/engine/vendor/cloud.google.com/go/internal/cloud.go new file mode 100644 index 0000000000..8e0c8f8e52 --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/internal/cloud.go @@ -0,0 +1,64 @@ +// Copyright 2014 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 internal provides support for the cloud packages. +// +// Users should not import this package directly. +package internal + +import ( + "fmt" + "net/http" +) + +const userAgent = "gcloud-golang/0.1" + +// Transport is an http.RoundTripper that appends Google Cloud client's +// user-agent to the original request's user-agent header. +type Transport struct { + // TODO(bradfitz): delete internal.Transport. It's too wrappy for what it does. + // Do User-Agent some other way. + + // Base is the actual http.RoundTripper + // requests will use. It must not be nil. + Base http.RoundTripper +} + +// RoundTrip appends a user-agent to the existing user-agent +// header and delegates the request to the base http.RoundTripper. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + req = cloneRequest(req) + ua := req.Header.Get("User-Agent") + if ua == "" { + ua = userAgent + } else { + ua = fmt.Sprintf("%s %s", ua, userAgent) + } + req.Header.Set("User-Agent", ua) + return t.Base.RoundTrip(req) +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header) + for k, s := range r.Header { + r2.Header[k] = s + } + return r2 +} diff --git a/components/engine/vendor/cloud.google.com/go/internal/retry.go b/components/engine/vendor/cloud.google.com/go/internal/retry.go new file mode 100644 index 0000000000..79995be4cc --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/internal/retry.go @@ -0,0 +1,55 @@ +// Copyright 2016 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 internal + +import ( + "fmt" + "time" + + gax "github.com/googleapis/gax-go" + + "golang.org/x/net/context" +) + +// Retry calls the supplied function f repeatedly according to the provided +// backoff parameters. It returns when one of the following occurs: +// When f's first return value is true, Retry immediately returns with f's second +// return value. +// When the provided context is done, Retry returns with ctx.Err(). +func Retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error)) error { + return retry(ctx, bo, f, gax.Sleep) +} + +func retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error), + sleep func(context.Context, time.Duration) error) error { + var lastErr error + for { + stop, err := f() + if stop { + return err + } + // Remember the last "real" error from f. + if err != nil && err != context.Canceled && err != context.DeadlineExceeded { + lastErr = err + } + p := bo.Pause() + if cerr := sleep(ctx, p); cerr != nil { + if lastErr != nil { + return fmt.Errorf("%v; last function err: %v", cerr, lastErr) + } + return cerr + } + } +} diff --git a/components/engine/vendor/cloud.google.com/go/logging/apiv2/config_client.go b/components/engine/vendor/cloud.google.com/go/logging/apiv2/config_client.go new file mode 100644 index 0000000000..d3091bec45 --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/apiv2/config_client.go @@ -0,0 +1,300 @@ +// Copyright 2016, 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. + +// AUTO-GENERATED CODE. DO NOT EDIT. + +package logging + +import ( + "fmt" + "math" + "runtime" + "strings" + "time" + + gax "github.com/googleapis/gax-go" + "golang.org/x/net/context" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/transport" + loggingpb "google.golang.org/genproto/googleapis/logging/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" +) + +var ( + configParentPathTemplate = gax.MustCompilePathTemplate("projects/{project}") + configSinkPathTemplate = gax.MustCompilePathTemplate("projects/{project}/sinks/{sink}") +) + +// ConfigCallOptions contains the retry settings for each method of ConfigClient. +type ConfigCallOptions struct { + ListSinks []gax.CallOption + GetSink []gax.CallOption + CreateSink []gax.CallOption + UpdateSink []gax.CallOption + DeleteSink []gax.CallOption +} + +func defaultConfigClientOptions() []option.ClientOption { + return []option.ClientOption{ + option.WithEndpoint("logging.googleapis.com:443"), + option.WithScopes( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read", + "https://www.googleapis.com/auth/logging.write", + ), + } +} + +func defaultConfigCallOptions() *ConfigCallOptions { + retry := map[[2]string][]gax.CallOption{ + {"default", "idempotent"}: { + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 1000 * time.Millisecond, + Multiplier: 1.2, + }) + }), + }, + } + return &ConfigCallOptions{ + ListSinks: retry[[2]string{"default", "idempotent"}], + GetSink: retry[[2]string{"default", "idempotent"}], + CreateSink: retry[[2]string{"default", "non_idempotent"}], + UpdateSink: retry[[2]string{"default", "non_idempotent"}], + DeleteSink: retry[[2]string{"default", "idempotent"}], + } +} + +// ConfigClient is a client for interacting with Stackdriver Logging API. +type ConfigClient struct { + // The connection to the service. + conn *grpc.ClientConn + + // The gRPC API client. + configClient loggingpb.ConfigServiceV2Client + + // The call options for this service. + CallOptions *ConfigCallOptions + + // The metadata to be sent with each request. + metadata metadata.MD +} + +// NewConfigClient creates a new config service v2 client. +// +// Service for configuring sinks used to export log entries outside of +// Stackdriver Logging. +func NewConfigClient(ctx context.Context, opts ...option.ClientOption) (*ConfigClient, error) { + conn, err := transport.DialGRPC(ctx, append(defaultConfigClientOptions(), opts...)...) + if err != nil { + return nil, err + } + c := &ConfigClient{ + conn: conn, + CallOptions: defaultConfigCallOptions(), + + configClient: loggingpb.NewConfigServiceV2Client(conn), + } + c.SetGoogleClientInfo("gax", gax.Version) + return c, nil +} + +// Connection returns the client's connection to the API service. +func (c *ConfigClient) Connection() *grpc.ClientConn { + return c.conn +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *ConfigClient) Close() error { + return c.conn.Close() +} + +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *ConfigClient) SetGoogleClientInfo(name, version string) { + goVersion := strings.Replace(runtime.Version(), " ", "_", -1) + v := fmt.Sprintf("%s/%s %s gax/%s go/%s", name, version, gapicNameVersion, gax.Version, goVersion) + c.metadata = metadata.Pairs("x-goog-api-client", v) +} + +// ConfigParentPath returns the path for the parent resource. +func ConfigParentPath(project string) string { + path, err := configParentPathTemplate.Render(map[string]string{ + "project": project, + }) + if err != nil { + panic(err) + } + return path +} + +// ConfigSinkPath returns the path for the sink resource. +func ConfigSinkPath(project, sink string) string { + path, err := configSinkPathTemplate.Render(map[string]string{ + "project": project, + "sink": sink, + }) + if err != nil { + panic(err) + } + return path +} + +// ListSinks lists sinks. +func (c *ConfigClient) ListSinks(ctx context.Context, req *loggingpb.ListSinksRequest) *LogSinkIterator { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + it := &LogSinkIterator{} + it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogSink, string, error) { + var resp *loggingpb.ListSinksResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.configClient.ListSinks(ctx, req) + return err + }, c.CallOptions.ListSinks...) + if err != nil { + return nil, "", err + } + return resp.Sinks, resp.NextPageToken, nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + return it +} + +// GetSink gets a sink. +func (c *ConfigClient) GetSink(ctx context.Context, req *loggingpb.GetSinkRequest) (*loggingpb.LogSink, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogSink + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.configClient.GetSink(ctx, req) + return err + }, c.CallOptions.GetSink...) + if err != nil { + return nil, err + } + return resp, nil +} + +// CreateSink creates a sink. +func (c *ConfigClient) CreateSink(ctx context.Context, req *loggingpb.CreateSinkRequest) (*loggingpb.LogSink, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogSink + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.configClient.CreateSink(ctx, req) + return err + }, c.CallOptions.CreateSink...) + if err != nil { + return nil, err + } + return resp, nil +} + +// UpdateSink updates or creates a sink. +func (c *ConfigClient) UpdateSink(ctx context.Context, req *loggingpb.UpdateSinkRequest) (*loggingpb.LogSink, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogSink + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.configClient.UpdateSink(ctx, req) + return err + }, c.CallOptions.UpdateSink...) + if err != nil { + return nil, err + } + return resp, nil +} + +// DeleteSink deletes a sink. +func (c *ConfigClient) DeleteSink(ctx context.Context, req *loggingpb.DeleteSinkRequest) error { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + _, err = c.configClient.DeleteSink(ctx, req) + return err + }, c.CallOptions.DeleteSink...) + return err +} + +// LogSinkIterator manages a stream of *loggingpb.LogSink. +type LogSinkIterator struct { + items []*loggingpb.LogSink + pageInfo *iterator.PageInfo + nextFunc func() error + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogSink, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *LogSinkIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *LogSinkIterator) Next() (*loggingpb.LogSink, error) { + var item *loggingpb.LogSink + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *LogSinkIterator) bufLen() int { + return len(it.items) +} + +func (it *LogSinkIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/components/engine/vendor/cloud.google.com/go/logging/apiv2/doc.go b/components/engine/vendor/cloud.google.com/go/logging/apiv2/doc.go new file mode 100644 index 0000000000..3a92278670 --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/apiv2/doc.go @@ -0,0 +1,26 @@ +// Copyright 2016, 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. + +// AUTO-GENERATED CODE. DO NOT EDIT. + +// Package logging is an experimental, auto-generated package for the +// logging API. +// +// The Stackdriver Logging API lets you write log entries and manage your +// logs, log sinks and logs-based metrics. +// +// Use the client at cloud.google.com/go/logging in preference to this. +package logging // import "cloud.google.com/go/logging/apiv2" + +const gapicNameVersion = "gapic/0.1.0" diff --git a/components/engine/vendor/cloud.google.com/go/logging/apiv2/logging_client.go b/components/engine/vendor/cloud.google.com/go/logging/apiv2/logging_client.go new file mode 100644 index 0000000000..321b1e2e7a --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/apiv2/logging_client.go @@ -0,0 +1,359 @@ +// Copyright 2016, 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. + +// AUTO-GENERATED CODE. DO NOT EDIT. + +package logging + +import ( + "fmt" + "math" + "runtime" + "strings" + "time" + + gax "github.com/googleapis/gax-go" + "golang.org/x/net/context" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/transport" + monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres" + loggingpb "google.golang.org/genproto/googleapis/logging/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" +) + +var ( + loggingParentPathTemplate = gax.MustCompilePathTemplate("projects/{project}") + loggingLogPathTemplate = gax.MustCompilePathTemplate("projects/{project}/logs/{log}") +) + +// CallOptions contains the retry settings for each method of Client. +type CallOptions struct { + DeleteLog []gax.CallOption + WriteLogEntries []gax.CallOption + ListLogEntries []gax.CallOption + ListMonitoredResourceDescriptors []gax.CallOption +} + +func defaultClientOptions() []option.ClientOption { + return []option.ClientOption{ + option.WithEndpoint("logging.googleapis.com:443"), + option.WithScopes( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read", + "https://www.googleapis.com/auth/logging.write", + ), + } +} + +func defaultCallOptions() *CallOptions { + retry := map[[2]string][]gax.CallOption{ + {"default", "idempotent"}: { + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 1000 * time.Millisecond, + Multiplier: 1.2, + }) + }), + }, + {"list", "idempotent"}: { + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 1000 * time.Millisecond, + Multiplier: 1.2, + }) + }), + }, + } + return &CallOptions{ + DeleteLog: retry[[2]string{"default", "idempotent"}], + WriteLogEntries: retry[[2]string{"default", "non_idempotent"}], + ListLogEntries: retry[[2]string{"list", "idempotent"}], + ListMonitoredResourceDescriptors: retry[[2]string{"default", "idempotent"}], + } +} + +// Client is a client for interacting with Stackdriver Logging API. +type Client struct { + // The connection to the service. + conn *grpc.ClientConn + + // The gRPC API client. + client loggingpb.LoggingServiceV2Client + + // The call options for this service. + CallOptions *CallOptions + + // The metadata to be sent with each request. + metadata metadata.MD +} + +// NewClient creates a new logging service v2 client. +// +// Service for ingesting and querying logs. +func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { + conn, err := transport.DialGRPC(ctx, append(defaultClientOptions(), opts...)...) + if err != nil { + return nil, err + } + c := &Client{ + conn: conn, + CallOptions: defaultCallOptions(), + + client: loggingpb.NewLoggingServiceV2Client(conn), + } + c.SetGoogleClientInfo("gax", gax.Version) + return c, nil +} + +// Connection returns the client's connection to the API service. +func (c *Client) Connection() *grpc.ClientConn { + return c.conn +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *Client) Close() error { + return c.conn.Close() +} + +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *Client) SetGoogleClientInfo(name, version string) { + goVersion := strings.Replace(runtime.Version(), " ", "_", -1) + v := fmt.Sprintf("%s/%s %s gax/%s go/%s", name, version, gapicNameVersion, gax.Version, goVersion) + c.metadata = metadata.Pairs("x-goog-api-client", v) +} + +// LoggingParentPath returns the path for the parent resource. +func LoggingParentPath(project string) string { + path, err := loggingParentPathTemplate.Render(map[string]string{ + "project": project, + }) + if err != nil { + panic(err) + } + return path +} + +// LoggingLogPath returns the path for the log resource. +func LoggingLogPath(project, log string) string { + path, err := loggingLogPathTemplate.Render(map[string]string{ + "project": project, + "log": log, + }) + if err != nil { + panic(err) + } + return path +} + +// DeleteLog deletes all the log entries in a log. +// The log reappears if it receives new entries. +func (c *Client) DeleteLog(ctx context.Context, req *loggingpb.DeleteLogRequest) error { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + _, err = c.client.DeleteLog(ctx, req) + return err + }, c.CallOptions.DeleteLog...) + return err +} + +// WriteLogEntries writes log entries to Stackdriver Logging. All log entries are +// written by this method. +func (c *Client) WriteLogEntries(ctx context.Context, req *loggingpb.WriteLogEntriesRequest) (*loggingpb.WriteLogEntriesResponse, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.WriteLogEntriesResponse + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.client.WriteLogEntries(ctx, req) + return err + }, c.CallOptions.WriteLogEntries...) + if err != nil { + return nil, err + } + return resp, nil +} + +// ListLogEntries lists log entries. Use this method to retrieve log entries from Cloud +// Logging. For ways to export log entries, see +// [Exporting Logs](/logging/docs/export). +func (c *Client) ListLogEntries(ctx context.Context, req *loggingpb.ListLogEntriesRequest) *LogEntryIterator { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + it := &LogEntryIterator{} + it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogEntry, string, error) { + var resp *loggingpb.ListLogEntriesResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.client.ListLogEntries(ctx, req) + return err + }, c.CallOptions.ListLogEntries...) + if err != nil { + return nil, "", err + } + return resp.Entries, resp.NextPageToken, nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + return it +} + +// ListMonitoredResourceDescriptors lists the monitored resource descriptors used by Stackdriver Logging. +func (c *Client) ListMonitoredResourceDescriptors(ctx context.Context, req *loggingpb.ListMonitoredResourceDescriptorsRequest) *MonitoredResourceDescriptorIterator { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + it := &MonitoredResourceDescriptorIterator{} + it.InternalFetch = func(pageSize int, pageToken string) ([]*monitoredrespb.MonitoredResourceDescriptor, string, error) { + var resp *loggingpb.ListMonitoredResourceDescriptorsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.client.ListMonitoredResourceDescriptors(ctx, req) + return err + }, c.CallOptions.ListMonitoredResourceDescriptors...) + if err != nil { + return nil, "", err + } + return resp.ResourceDescriptors, resp.NextPageToken, nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + return it +} + +// LogEntryIterator manages a stream of *loggingpb.LogEntry. +type LogEntryIterator struct { + items []*loggingpb.LogEntry + pageInfo *iterator.PageInfo + nextFunc func() error + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogEntry, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *LogEntryIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *LogEntryIterator) Next() (*loggingpb.LogEntry, error) { + var item *loggingpb.LogEntry + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *LogEntryIterator) bufLen() int { + return len(it.items) +} + +func (it *LogEntryIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} + +// MonitoredResourceDescriptorIterator manages a stream of *monitoredrespb.MonitoredResourceDescriptor. +type MonitoredResourceDescriptorIterator struct { + items []*monitoredrespb.MonitoredResourceDescriptor + pageInfo *iterator.PageInfo + nextFunc func() error + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*monitoredrespb.MonitoredResourceDescriptor, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *MonitoredResourceDescriptorIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *MonitoredResourceDescriptorIterator) Next() (*monitoredrespb.MonitoredResourceDescriptor, error) { + var item *monitoredrespb.MonitoredResourceDescriptor + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *MonitoredResourceDescriptorIterator) bufLen() int { + return len(it.items) +} + +func (it *MonitoredResourceDescriptorIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/components/engine/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go b/components/engine/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go new file mode 100644 index 0000000000..234597846b --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/apiv2/metrics_client.go @@ -0,0 +1,299 @@ +// Copyright 2016, 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. + +// AUTO-GENERATED CODE. DO NOT EDIT. + +package logging + +import ( + "fmt" + "math" + "runtime" + "strings" + "time" + + gax "github.com/googleapis/gax-go" + "golang.org/x/net/context" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/transport" + loggingpb "google.golang.org/genproto/googleapis/logging/v2" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" +) + +var ( + metricsParentPathTemplate = gax.MustCompilePathTemplate("projects/{project}") + metricsMetricPathTemplate = gax.MustCompilePathTemplate("projects/{project}/metrics/{metric}") +) + +// MetricsCallOptions contains the retry settings for each method of MetricsClient. +type MetricsCallOptions struct { + ListLogMetrics []gax.CallOption + GetLogMetric []gax.CallOption + CreateLogMetric []gax.CallOption + UpdateLogMetric []gax.CallOption + DeleteLogMetric []gax.CallOption +} + +func defaultMetricsClientOptions() []option.ClientOption { + return []option.ClientOption{ + option.WithEndpoint("logging.googleapis.com:443"), + option.WithScopes( + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/logging.admin", + "https://www.googleapis.com/auth/logging.read", + "https://www.googleapis.com/auth/logging.write", + ), + } +} + +func defaultMetricsCallOptions() *MetricsCallOptions { + retry := map[[2]string][]gax.CallOption{ + {"default", "idempotent"}: { + gax.WithRetry(func() gax.Retryer { + return gax.OnCodes([]codes.Code{ + codes.DeadlineExceeded, + codes.Unavailable, + }, gax.Backoff{ + Initial: 100 * time.Millisecond, + Max: 1000 * time.Millisecond, + Multiplier: 1.2, + }) + }), + }, + } + return &MetricsCallOptions{ + ListLogMetrics: retry[[2]string{"default", "idempotent"}], + GetLogMetric: retry[[2]string{"default", "idempotent"}], + CreateLogMetric: retry[[2]string{"default", "non_idempotent"}], + UpdateLogMetric: retry[[2]string{"default", "non_idempotent"}], + DeleteLogMetric: retry[[2]string{"default", "idempotent"}], + } +} + +// MetricsClient is a client for interacting with Stackdriver Logging API. +type MetricsClient struct { + // The connection to the service. + conn *grpc.ClientConn + + // The gRPC API client. + metricsClient loggingpb.MetricsServiceV2Client + + // The call options for this service. + CallOptions *MetricsCallOptions + + // The metadata to be sent with each request. + metadata metadata.MD +} + +// NewMetricsClient creates a new metrics service v2 client. +// +// Service for configuring logs-based metrics. +func NewMetricsClient(ctx context.Context, opts ...option.ClientOption) (*MetricsClient, error) { + conn, err := transport.DialGRPC(ctx, append(defaultMetricsClientOptions(), opts...)...) + if err != nil { + return nil, err + } + c := &MetricsClient{ + conn: conn, + CallOptions: defaultMetricsCallOptions(), + + metricsClient: loggingpb.NewMetricsServiceV2Client(conn), + } + c.SetGoogleClientInfo("gax", gax.Version) + return c, nil +} + +// Connection returns the client's connection to the API service. +func (c *MetricsClient) Connection() *grpc.ClientConn { + return c.conn +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *MetricsClient) Close() error { + return c.conn.Close() +} + +// SetGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *MetricsClient) SetGoogleClientInfo(name, version string) { + goVersion := strings.Replace(runtime.Version(), " ", "_", -1) + v := fmt.Sprintf("%s/%s %s gax/%s go/%s", name, version, gapicNameVersion, gax.Version, goVersion) + c.metadata = metadata.Pairs("x-goog-api-client", v) +} + +// MetricsParentPath returns the path for the parent resource. +func MetricsParentPath(project string) string { + path, err := metricsParentPathTemplate.Render(map[string]string{ + "project": project, + }) + if err != nil { + panic(err) + } + return path +} + +// MetricsMetricPath returns the path for the metric resource. +func MetricsMetricPath(project, metric string) string { + path, err := metricsMetricPathTemplate.Render(map[string]string{ + "project": project, + "metric": metric, + }) + if err != nil { + panic(err) + } + return path +} + +// ListLogMetrics lists logs-based metrics. +func (c *MetricsClient) ListLogMetrics(ctx context.Context, req *loggingpb.ListLogMetricsRequest) *LogMetricIterator { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + it := &LogMetricIterator{} + it.InternalFetch = func(pageSize int, pageToken string) ([]*loggingpb.LogMetric, string, error) { + var resp *loggingpb.ListLogMetricsResponse + req.PageToken = pageToken + if pageSize > math.MaxInt32 { + req.PageSize = math.MaxInt32 + } else { + req.PageSize = int32(pageSize) + } + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.metricsClient.ListLogMetrics(ctx, req) + return err + }, c.CallOptions.ListLogMetrics...) + if err != nil { + return nil, "", err + } + return resp.Metrics, resp.NextPageToken, nil + } + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + return it +} + +// GetLogMetric gets a logs-based metric. +func (c *MetricsClient) GetLogMetric(ctx context.Context, req *loggingpb.GetLogMetricRequest) (*loggingpb.LogMetric, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogMetric + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.metricsClient.GetLogMetric(ctx, req) + return err + }, c.CallOptions.GetLogMetric...) + if err != nil { + return nil, err + } + return resp, nil +} + +// CreateLogMetric creates a logs-based metric. +func (c *MetricsClient) CreateLogMetric(ctx context.Context, req *loggingpb.CreateLogMetricRequest) (*loggingpb.LogMetric, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogMetric + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.metricsClient.CreateLogMetric(ctx, req) + return err + }, c.CallOptions.CreateLogMetric...) + if err != nil { + return nil, err + } + return resp, nil +} + +// UpdateLogMetric creates or updates a logs-based metric. +func (c *MetricsClient) UpdateLogMetric(ctx context.Context, req *loggingpb.UpdateLogMetricRequest) (*loggingpb.LogMetric, error) { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + var resp *loggingpb.LogMetric + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + resp, err = c.metricsClient.UpdateLogMetric(ctx, req) + return err + }, c.CallOptions.UpdateLogMetric...) + if err != nil { + return nil, err + } + return resp, nil +} + +// DeleteLogMetric deletes a logs-based metric. +func (c *MetricsClient) DeleteLogMetric(ctx context.Context, req *loggingpb.DeleteLogMetricRequest) error { + md, _ := metadata.FromContext(ctx) + ctx = metadata.NewContext(ctx, metadata.Join(md, c.metadata)) + err := gax.Invoke(ctx, func(ctx context.Context) error { + var err error + _, err = c.metricsClient.DeleteLogMetric(ctx, req) + return err + }, c.CallOptions.DeleteLogMetric...) + return err +} + +// LogMetricIterator manages a stream of *loggingpb.LogMetric. +type LogMetricIterator struct { + items []*loggingpb.LogMetric + pageInfo *iterator.PageInfo + nextFunc func() error + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*loggingpb.LogMetric, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *LogMetricIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *LogMetricIterator) Next() (*loggingpb.LogMetric, error) { + var item *loggingpb.LogMetric + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *LogMetricIterator) bufLen() int { + return len(it.items) +} + +func (it *LogMetricIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/components/engine/vendor/cloud.google.com/go/logging/doc.go b/components/engine/vendor/cloud.google.com/go/logging/doc.go new file mode 100644 index 0000000000..6da3adf129 --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/doc.go @@ -0,0 +1,89 @@ +// Copyright 2016 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 logging contains a Stackdriver Logging client suitable for writing logs. +For reading logs, and working with sinks, metrics and monitored resources, +see package cloud.google.com/go/logging/logadmin. + +This client uses Logging API v2. +See https://cloud.google.com/logging/docs/api/v2/ for an introduction to the API. + +This package is experimental and subject to API changes. + + +Creating a Client + +Use a Client to interact with the Stackdriver Logging API. + + // Create a Client + ctx := context.Background() + client, err := logging.NewClient(ctx, "my-project") + if err != nil { + // TODO: Handle error. + } + + +Basic Usage + +For most use-cases, you'll want to add log entries to a buffer to be periodically +flushed (automatically and asynchronously) to the Stackdriver Logging service. + + // Initialize a logger + lg := client.Logger("my-log") + + // Add entry to log buffer + lg.Log(logging.Entry{Payload: "something happened!"}) + + +Closing your Client + +You should call Client.Close before your program exits to flush any buffered log entries to the Stackdriver Logging service. + + // Close the client when finished. + err = client.Close() + if err != nil { + // TODO: Handle error. + } + + +Synchronous Logging + +For critical errors, you may want to send your log entries immediately. +LogSync is slow and will block until the log entry has been sent, so it is +not recommended for basic use. + + lg.LogSync(ctx, logging.Entry{Payload: "ALERT! Something critical happened!"}) + + +The Standard Logger Interface + +You may want use a standard log.Logger in your program. + + // stdlg implements log.Logger + stdlg := lg.StandardLogger(logging.Info) + stdlg.Println("some info") + + +Log Levels + +An Entry may have one of a number of severity levels associated with it. + + logging.Entry{ + Payload: "something terrible happened!", + Severity: logging.Critical, + } + +*/ +package logging // import "cloud.google.com/go/logging" diff --git a/components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq.go b/components/engine/vendor/cloud.google.com/go/logging/internal/common.go similarity index 62% rename from components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq.go rename to components/engine/vendor/cloud.google.com/go/logging/internal/common.go index ddae71ccef..7d8ece09d8 100644 --- a/components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq.go +++ b/components/engine/vendor/cloud.google.com/go/logging/internal/common.go @@ -1,4 +1,4 @@ -// Copyright 2015 Google Inc. All Rights Reserved. +// Copyright 2016 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. @@ -12,18 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build go1.5 +package internal -package transport +import ( + "fmt" + "strings" +) -import "net/http" +const ( + ProdAddr = "logging.googleapis.com:443" + Version = "0.2.0" +) -// makeReqCancel returns a closure that cancels the given http.Request -// when called. -func makeReqCancel(req *http.Request) func(http.RoundTripper) { - c := make(chan struct{}) - req.Cancel = c - return func(http.RoundTripper) { - close(c) - } +func LogPath(parent, logID string) string { + logID = strings.Replace(logID, "/", "%2F", -1) + return fmt.Sprintf("%s/logs/%s", parent, logID) } diff --git a/components/engine/vendor/cloud.google.com/go/logging/logging.go b/components/engine/vendor/cloud.google.com/go/logging/logging.go new file mode 100644 index 0000000000..8506800ffe --- /dev/null +++ b/components/engine/vendor/cloud.google.com/go/logging/logging.go @@ -0,0 +1,674 @@ +// Copyright 2016 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. + +// API/gRPC features intentionally missing from this client: +// - You cannot have the server pick the time of the entry. This client +// always sends a time. +// - There is no way to provide a protocol buffer payload. +// - No support for the "partial success" feature when writing log entries. + +// TODO(jba): test whether forward-slash characters in the log ID must be URL-encoded. +// These features are missing now, but will likely be added: +// - There is no way to specify CallOptions. + +package logging + +import ( + "encoding/json" + "errors" + "fmt" + "log" + "math" + "net/http" + "strconv" + "strings" + "sync" + "time" + + vkit "cloud.google.com/go/logging/apiv2" + "cloud.google.com/go/logging/internal" + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" + structpb "github.com/golang/protobuf/ptypes/struct" + tspb "github.com/golang/protobuf/ptypes/timestamp" + "golang.org/x/net/context" + "google.golang.org/api/option" + "google.golang.org/api/support/bundler" + mrpb "google.golang.org/genproto/googleapis/api/monitoredres" + logtypepb "google.golang.org/genproto/googleapis/logging/type" + logpb "google.golang.org/genproto/googleapis/logging/v2" +) + +const ( + // Scope for reading from the logging service. + ReadScope = "https://www.googleapis.com/auth/logging.read" + + // Scope for writing to the logging service. + WriteScope = "https://www.googleapis.com/auth/logging.write" + + // Scope for administrative actions on the logging service. + AdminScope = "https://www.googleapis.com/auth/logging.admin" +) + +const ( + // defaultErrorCapacity is the capacity of the channel used to deliver + // errors to the OnError function. + defaultErrorCapacity = 10 + + // DefaultDelayThreshold is the default value for the DelayThreshold LoggerOption. + DefaultDelayThreshold = time.Second + + // DefaultEntryCountThreshold is the default value for the EntryCountThreshold LoggerOption. + DefaultEntryCountThreshold = 1000 + + // DefaultEntryByteThreshold is the default value for the EntryByteThreshold LoggerOption. + DefaultEntryByteThreshold = 1 << 20 // 1MiB + + // DefaultBufferedByteLimit is the default value for the BufferedByteLimit LoggerOption. + DefaultBufferedByteLimit = 1 << 30 // 1GiB +) + +// For testing: +var now = time.Now + +// ErrOverflow signals that the number of buffered entries for a Logger +// exceeds its BufferLimit. +var ErrOverflow = errors.New("logging: log entry overflowed buffer limits") + +// Client is a Logging client. A Client is associated with a single Cloud project. +type Client struct { + client *vkit.Client // client for the logging service + projectID string + errc chan error // should be buffered to minimize dropped errors + donec chan struct{} // closed on Client.Close to close Logger bundlers + loggers sync.WaitGroup // so we can wait for loggers to close + closed bool + + // OnError is called when an error occurs in a call to Log or Flush. The + // error may be due to an invalid Entry, an overflow because BufferLimit + // was reached (in which case the error will be ErrOverflow) or an error + // communicating with the logging service. OnError is called with errors + // from all Loggers. It is never called concurrently. OnError is expected + // to return quickly; if errors occur while OnError is running, some may + // not be reported. The default behavior is to call log.Printf. + // + // This field should be set only once, before any method of Client is called. + OnError func(err error) +} + +// NewClient returns a new logging client associated with the provided project ID. +// +// By default NewClient uses WriteScope. To use a different scope, call +// NewClient using a WithScopes option (see https://godoc.org/google.golang.org/api/option#WithScopes). +func NewClient(ctx context.Context, projectID string, opts ...option.ClientOption) (*Client, error) { + // Check for '/' in project ID to reserve the ability to support various owning resources, + // in the form "{Collection}/{Name}", for instance "organizations/my-org". + if strings.ContainsRune(projectID, '/') { + return nil, errors.New("logging: project ID contains '/'") + } + opts = append([]option.ClientOption{ + option.WithEndpoint(internal.ProdAddr), + option.WithScopes(WriteScope), + }, opts...) + c, err := vkit.NewClient(ctx, opts...) + if err != nil { + return nil, err + } + c.SetGoogleClientInfo("logging", internal.Version) + client := &Client{ + client: c, + projectID: projectID, + errc: make(chan error, defaultErrorCapacity), // create a small buffer for errors + donec: make(chan struct{}), + OnError: func(e error) { log.Printf("logging client: %v", e) }, + } + // Call the user's function synchronously, to make life easier for them. + go func() { + for err := range client.errc { + // This reference to OnError is memory-safe if the user sets OnError before + // calling any client methods. The reference happens before the first read from + // client.errc, which happens before the first write to client.errc, which + // happens before any call, which happens before the user sets OnError. + if fn := client.OnError; fn != nil { + fn(err) + } else { + log.Printf("logging (project ID %q): %v", projectID, err) + } + } + }() + return client, nil +} + +// parent returns the string used in many RPCs to denote the parent resource of the log. +func (c *Client) parent() string { + return "projects/" + c.projectID +} + +var unixZeroTimestamp *tspb.Timestamp + +func init() { + var err error + unixZeroTimestamp, err = ptypes.TimestampProto(time.Unix(0, 0)) + if err != nil { + panic(err) + } +} + +// Ping reports whether the client's connection to the logging service and the +// authentication configuration are valid. To accomplish this, Ping writes a +// log entry "ping" to a log named "ping". +func (c *Client) Ping(ctx context.Context) error { + ent := &logpb.LogEntry{ + Payload: &logpb.LogEntry_TextPayload{"ping"}, + Timestamp: unixZeroTimestamp, // Identical timestamps and insert IDs are both + InsertId: "ping", // necessary for the service to dedup these entries. + } + _, err := c.client.WriteLogEntries(ctx, &logpb.WriteLogEntriesRequest{ + LogName: internal.LogPath(c.parent(), "ping"), + Resource: &mrpb.MonitoredResource{Type: "global"}, + Entries: []*logpb.LogEntry{ent}, + }) + return err +} + +// A Logger is used to write log messages to a single log. It can be configured +// with a log ID, common monitored resource, and a set of common labels. +type Logger struct { + client *Client + logName string // "projects/{projectID}/logs/{logID}" + stdLoggers map[Severity]*log.Logger + bundler *bundler.Bundler + + // Options + commonResource *mrpb.MonitoredResource + commonLabels map[string]string +} + +// A LoggerOption is a configuration option for a Logger. +type LoggerOption interface { + set(*Logger) +} + +// CommonResource sets the monitored resource associated with all log entries +// written from a Logger. If not provided, a resource of type "global" is used. +// This value can be overridden by setting an Entry's Resource field. +func CommonResource(r *mrpb.MonitoredResource) LoggerOption { return commonResource{r} } + +type commonResource struct{ *mrpb.MonitoredResource } + +func (r commonResource) set(l *Logger) { l.commonResource = r.MonitoredResource } + +// CommonLabels are labels that apply to all log entries written from a Logger, +// so that you don't have to repeat them in each log entry's Labels field. If +// any of the log entries contains a (key, value) with the same key that is in +// CommonLabels, then the entry's (key, value) overrides the one in +// CommonLabels. +func CommonLabels(m map[string]string) LoggerOption { return commonLabels(m) } + +type commonLabels map[string]string + +func (c commonLabels) set(l *Logger) { l.commonLabels = c } + +// DelayThreshold is the maximum amount of time that an entry should remain +// buffered in memory before a call to the logging service is triggered. Larger +// values of DelayThreshold will generally result in fewer calls to the logging +// service, while increasing the risk that log entries will be lost if the +// process crashes. +// The default is DefaultDelayThreshold. +func DelayThreshold(d time.Duration) LoggerOption { return delayThreshold(d) } + +type delayThreshold time.Duration + +func (d delayThreshold) set(l *Logger) { l.bundler.DelayThreshold = time.Duration(d) } + +// EntryCountThreshold is the maximum number of entries that will be buffered +// in memory before a call to the logging service is triggered. Larger values +// will generally result in fewer calls to the logging service, while +// increasing both memory consumption and the risk that log entries will be +// lost if the process crashes. +// The default is DefaultEntryCountThreshold. +func EntryCountThreshold(n int) LoggerOption { return entryCountThreshold(n) } + +type entryCountThreshold int + +func (e entryCountThreshold) set(l *Logger) { l.bundler.BundleCountThreshold = int(e) } + +// EntryByteThreshold is the maximum number of bytes of entries that will be +// buffered in memory before a call to the logging service is triggered. See +// EntryCountThreshold for a discussion of the tradeoffs involved in setting +// this option. +// The default is DefaultEntryByteThreshold. +func EntryByteThreshold(n int) LoggerOption { return entryByteThreshold(n) } + +type entryByteThreshold int + +func (e entryByteThreshold) set(l *Logger) { l.bundler.BundleByteThreshold = int(e) } + +// EntryByteLimit is the maximum number of bytes of entries that will be sent +// in a single call to the logging service. This option limits the size of a +// single RPC payload, to account for network or service issues with large +// RPCs. If EntryByteLimit is smaller than EntryByteThreshold, the latter has +// no effect. +// The default is zero, meaning there is no limit. +func EntryByteLimit(n int) LoggerOption { return entryByteLimit(n) } + +type entryByteLimit int + +func (e entryByteLimit) set(l *Logger) { l.bundler.BundleByteLimit = int(e) } + +// BufferedByteLimit is the maximum number of bytes that the Logger will keep +// in memory before returning ErrOverflow. This option limits the total memory +// consumption of the Logger (but note that each Logger has its own, separate +// limit). It is possible to reach BufferedByteLimit even if it is larger than +// EntryByteThreshold or EntryByteLimit, because calls triggered by the latter +// two options may be enqueued (and hence occupying memory) while new log +// entries are being added. +// The default is DefaultBufferedByteLimit. +func BufferedByteLimit(n int) LoggerOption { return bufferedByteLimit(n) } + +type bufferedByteLimit int + +func (b bufferedByteLimit) set(l *Logger) { l.bundler.BufferedByteLimit = int(b) } + +// Logger returns a Logger that will write entries with the given log ID, such as +// "syslog". A log ID must be less than 512 characters long and can only +// include the following characters: upper and lower case alphanumeric +// characters: [A-Za-z0-9]; and punctuation characters: forward-slash, +// underscore, hyphen, and period. +func (c *Client) Logger(logID string, opts ...LoggerOption) *Logger { + l := &Logger{ + client: c, + logName: internal.LogPath(c.parent(), logID), + commonResource: &mrpb.MonitoredResource{Type: "global"}, + } + // TODO(jba): determine the right context for the bundle handler. + ctx := context.TODO() + l.bundler = bundler.NewBundler(&logpb.LogEntry{}, func(entries interface{}) { + l.writeLogEntries(ctx, entries.([]*logpb.LogEntry)) + }) + l.bundler.DelayThreshold = DefaultDelayThreshold + l.bundler.BundleCountThreshold = DefaultEntryCountThreshold + l.bundler.BundleByteThreshold = DefaultEntryByteThreshold + l.bundler.BufferedByteLimit = DefaultBufferedByteLimit + for _, opt := range opts { + opt.set(l) + } + + l.stdLoggers = map[Severity]*log.Logger{} + for s := range severityName { + l.stdLoggers[s] = log.New(severityWriter{l, s}, "", 0) + } + c.loggers.Add(1) + go func() { + defer c.loggers.Done() + <-c.donec + l.bundler.Close() + }() + return l +} + +type severityWriter struct { + l *Logger + s Severity +} + +func (w severityWriter) Write(p []byte) (n int, err error) { + w.l.Log(Entry{ + Severity: w.s, + Payload: string(p), + }) + return len(p), nil +} + +// Close closes the client. +func (c *Client) Close() error { + if c.closed { + return nil + } + close(c.donec) // close Logger bundlers + c.loggers.Wait() // wait for all bundlers to flush and close + // Now there can be no more errors. + close(c.errc) // terminate error goroutine + // Return only the first error. Since all clients share an underlying connection, + // Closes after the first always report a "connection is closing" error. + err := c.client.Close() + c.closed = true + return err +} + +// Severity is the severity of the event described in a log entry. These +// guideline severity levels are ordered, with numerically smaller levels +// treated as less severe than numerically larger levels. +type Severity int + +const ( + // Default means the log entry has no assigned severity level. + Default = Severity(logtypepb.LogSeverity_DEFAULT) + // Debug means debug or trace information. + Debug = Severity(logtypepb.LogSeverity_DEBUG) + // Info means routine information, such as ongoing status or performance. + Info = Severity(logtypepb.LogSeverity_INFO) + // Notice means normal but significant events, such as start up, shut down, or configuration. + Notice = Severity(logtypepb.LogSeverity_NOTICE) + // Warning means events that might cause problems. + Warning = Severity(logtypepb.LogSeverity_WARNING) + // Error means events that are likely to cause problems. + Error = Severity(logtypepb.LogSeverity_ERROR) + // Critical means events that cause more severe problems or brief outages. + Critical = Severity(logtypepb.LogSeverity_CRITICAL) + // Alert means a person must take an action immediately. + Alert = Severity(logtypepb.LogSeverity_ALERT) + // Emergency means one or more systems are unusable. + Emergency = Severity(logtypepb.LogSeverity_EMERGENCY) +) + +var severityName = map[Severity]string{ + Default: "Default", + Debug: "Debug", + Info: "Info", + Notice: "Notice", + Warning: "Warning", + Error: "Error", + Critical: "Critical", + Alert: "Alert", + Emergency: "Emergency", +} + +// String converts a severity level to a string. +func (v Severity) String() string { + // same as proto.EnumName + s, ok := severityName[v] + if ok { + return s + } + return strconv.Itoa(int(v)) +} + +// ParseSeverity returns the Severity whose name equals s, ignoring case. It +// returns Default if no Severity matches. +func ParseSeverity(s string) Severity { + sl := strings.ToLower(s) + for sev, name := range severityName { + if strings.ToLower(name) == sl { + return sev + } + } + return Default +} + +// Entry is a log entry. +// See https://cloud.google.com/logging/docs/view/logs_index for more about entries. +type Entry struct { + // Timestamp is the time of the entry. If zero, the current time is used. + Timestamp time.Time + + // Severity is the entry's severity level. + // The zero value is Default. + Severity Severity + + // Payload must be either a string or something that + // marshals via the encoding/json package to a JSON object + // (and not any other type of JSON value). + Payload interface{} + + // Labels optionally specifies key/value labels for the log entry. + // The Logger.Log method takes ownership of this map. See Logger.CommonLabels + // for more about labels. + Labels map[string]string + + // InsertID is a unique ID for the log entry. If you provide this field, + // the logging service considers other log entries in the same log with the + // same ID as duplicates which can be removed. If omitted, the logging + // service will generate a unique ID for this log entry. Note that because + // this client retries RPCs automatically, it is possible (though unlikely) + // that an Entry without an InsertID will be written more than once. + InsertID string + + // HTTPRequest optionally specifies metadata about the HTTP request + // associated with this log entry, if applicable. It is optional. + HTTPRequest *HTTPRequest + + // Operation optionally provides information about an operation associated + // with the log entry, if applicable. + Operation *logpb.LogEntryOperation + + // LogName is the full log name, in the form + // "projects/{ProjectID}/logs/{LogID}". It is set by the client when + // reading entries. It is an error to set it when writing entries. + LogName string + + // Resource is the monitored resource associated with the entry. It is set + // by the client when reading entries. It is an error to set it when + // writing entries. + Resource *mrpb.MonitoredResource +} + +// HTTPRequest contains an http.Request as well as additional +// information about the request and its response. +type HTTPRequest struct { + // Request is the http.Request passed to the handler. + Request *http.Request + + // RequestSize is the size of the HTTP request message in bytes, including + // the request headers and the request body. + RequestSize int64 + + // Status is the response code indicating the status of the response. + // Examples: 200, 404. + Status int + + // ResponseSize is the size of the HTTP response message sent back to the client, in bytes, + // including the response headers and the response body. + ResponseSize int64 + + // Latency is the request processing latency on the server, from the time the request was + // received until the response was sent. + Latency time.Duration + + // RemoteIP is 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 + + // CacheHit reports whether an entity was served from cache (with or without + // validation). + CacheHit bool + + // CacheValidatedWithOriginServer reports whether the response was + // validated with the origin server before being served from cache. This + // field is only meaningful if CacheHit is true. + CacheValidatedWithOriginServer bool +} + +func fromHTTPRequest(r *HTTPRequest) *logtypepb.HttpRequest { + if r == nil { + return nil + } + if r.Request == nil { + panic("HTTPRequest must have a non-nil Request") + } + u := *r.Request.URL + u.Fragment = "" + return &logtypepb.HttpRequest{ + RequestMethod: r.Request.Method, + RequestUrl: u.String(), + RequestSize: r.RequestSize, + Status: int32(r.Status), + ResponseSize: r.ResponseSize, + Latency: ptypes.DurationProto(r.Latency), + UserAgent: r.Request.UserAgent(), + RemoteIp: r.RemoteIP, // TODO(jba): attempt to parse http.Request.RemoteAddr? + Referer: r.Request.Referer(), + CacheHit: r.CacheHit, + CacheValidatedWithOriginServer: r.CacheValidatedWithOriginServer, + } +} + +// toProtoStruct converts v, which must marshal into a JSON object, +// into a Google Struct proto. +func toProtoStruct(v interface{}) (*structpb.Struct, error) { + // Fast path: if v is already a *structpb.Struct, nothing to do. + if s, ok := v.(*structpb.Struct); ok { + return s, nil + } + // v is a Go struct that supports JSON marshalling. We want a Struct + // protobuf. Some day we may have a more direct way to get there, but right + // now the only way is to marshal the Go struct to JSON, unmarshal into a + // map, and then build the Struct proto from the map. + jb, err := json.Marshal(v) + if err != nil { + return nil, fmt.Errorf("logging: json.Marshal: %v", err) + } + var m map[string]interface{} + err = json.Unmarshal(jb, &m) + if err != nil { + return nil, fmt.Errorf("logging: json.Unmarshal: %v", err) + } + return jsonMapToProtoStruct(m), nil +} + +func jsonMapToProtoStruct(m map[string]interface{}) *structpb.Struct { + fields := map[string]*structpb.Value{} + for k, v := range m { + fields[k] = jsonValueToStructValue(v) + } + return &structpb.Struct{Fields: fields} +} + +func jsonValueToStructValue(v interface{}) *structpb.Value { + switch x := v.(type) { + case bool: + return &structpb.Value{Kind: &structpb.Value_BoolValue{x}} + case float64: + return &structpb.Value{Kind: &structpb.Value_NumberValue{x}} + case string: + return &structpb.Value{Kind: &structpb.Value_StringValue{x}} + case nil: + return &structpb.Value{Kind: &structpb.Value_NullValue{}} + case map[string]interface{}: + return &structpb.Value{Kind: &structpb.Value_StructValue{jsonMapToProtoStruct(x)}} + case []interface{}: + var vals []*structpb.Value + for _, e := range x { + vals = append(vals, jsonValueToStructValue(e)) + } + return &structpb.Value{Kind: &structpb.Value_ListValue{&structpb.ListValue{vals}}} + default: + panic(fmt.Sprintf("bad type %T for JSON value", v)) + } +} + +// LogSync logs the Entry synchronously without any buffering. Because LogSync is slow +// and will block, it is intended primarily for debugging or critical errors. +// Prefer Log for most uses. +// TODO(jba): come up with a better name (LogNow?) or eliminate. +func (l *Logger) LogSync(ctx context.Context, e Entry) error { + ent, err := toLogEntry(e) + if err != nil { + return err + } + _, err = l.client.client.WriteLogEntries(ctx, &logpb.WriteLogEntriesRequest{ + LogName: l.logName, + Resource: l.commonResource, + Labels: l.commonLabels, + Entries: []*logpb.LogEntry{ent}, + }) + return err +} + +// Log buffers the Entry for output to the logging service. It never blocks. +func (l *Logger) Log(e Entry) { + ent, err := toLogEntry(e) + if err != nil { + l.error(err) + return + } + if err := l.bundler.Add(ent, proto.Size(ent)); err != nil { + l.error(err) + } +} + +// Flush blocks until all currently buffered log entries are sent. +func (l *Logger) Flush() { + l.bundler.Flush() +} + +func (l *Logger) writeLogEntries(ctx context.Context, entries []*logpb.LogEntry) { + req := &logpb.WriteLogEntriesRequest{ + LogName: l.logName, + Resource: l.commonResource, + Labels: l.commonLabels, + Entries: entries, + } + _, err := l.client.client.WriteLogEntries(ctx, req) + if err != nil { + l.error(err) + } +} + +// error puts the error on the client's error channel +// without blocking. +func (l *Logger) error(err error) { + select { + case l.client.errc <- err: + default: + } +} + +// StandardLogger returns a *log.Logger for the provided severity. +// +// This method is cheap. A single log.Logger is pre-allocated for each +// severity level in each Logger. Callers may mutate the returned log.Logger +// (for example by calling SetFlags or SetPrefix). +func (l *Logger) StandardLogger(s Severity) *log.Logger { return l.stdLoggers[s] } + +func trunc32(i int) int32 { + if i > math.MaxInt32 { + i = math.MaxInt32 + } + return int32(i) +} + +func toLogEntry(e Entry) (*logpb.LogEntry, error) { + if e.LogName != "" { + return nil, errors.New("logging: Entry.LogName should be not be set when writing") + } + t := e.Timestamp + if t.IsZero() { + t = now() + } + ts, err := ptypes.TimestampProto(t) + if err != nil { + return nil, err + } + ent := &logpb.LogEntry{ + Timestamp: ts, + Severity: logtypepb.LogSeverity(e.Severity), + InsertId: e.InsertID, + HttpRequest: fromHTTPRequest(e.HTTPRequest), + Operation: e.Operation, + Labels: e.Labels, + } + + switch p := e.Payload.(type) { + case string: + ent.Payload = &logpb.LogEntry_TextPayload{p} + default: + s, err := toProtoStruct(p) + if err != nil { + return nil, err + } + ent.Payload = &logpb.LogEntry_JsonPayload{s} + } + return ent, nil +} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go b/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go new file mode 100644 index 0000000000..46c765a96e --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.pb.go @@ -0,0 +1,69 @@ +// Code generated by protoc-gen-go. +// source: github.com/golang/protobuf/ptypes/empty/empty.proto +// DO NOT EDIT! + +/* +Package empty is a generated protocol buffer package. + +It is generated from these files: + github.com/golang/protobuf/ptypes/empty/empty.proto + +It has these top-level messages: + Empty +*/ +package empty + +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 generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +type Empty struct { +} + +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 (*Empty) XXX_WellKnownType() string { return "Empty" } + +func init() { + proto.RegisterType((*Empty)(nil), "google.protobuf.Empty") +} + +func init() { + proto.RegisterFile("github.com/golang/protobuf/ptypes/empty/empty.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 150 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0x4e, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28, + 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xcd, + 0x2d, 0x28, 0xa9, 0x84, 0x90, 0x7a, 0x60, 0x39, 0x21, 0xfe, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54, + 0x3d, 0x98, 0x4a, 0x25, 0x76, 0x2e, 0x56, 0x57, 0x90, 0xbc, 0x53, 0x25, 0x97, 0x70, 0x72, 0x7e, + 0xae, 0x1e, 0x9a, 0xbc, 0x13, 0x17, 0x58, 0x36, 0x00, 0xc4, 0x0d, 0x60, 0x8c, 0x52, 0x27, 0xd2, + 0xce, 0x05, 0x8c, 0x8c, 0x3f, 0x18, 0x19, 0x17, 0x31, 0x31, 0xbb, 0x07, 0x38, 0xad, 0x62, 0x92, + 0x73, 0x87, 0x18, 0x1a, 0x00, 0x55, 0xaa, 0x17, 0x9e, 0x9a, 0x93, 0xe3, 0x9d, 0x97, 0x5f, 0x9e, + 0x17, 0x02, 0xd2, 0x92, 0xc4, 0x06, 0x36, 0xc3, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x7f, 0xbb, + 0xf4, 0x0e, 0xd2, 0x00, 0x00, 0x00, +} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto b/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto new file mode 100644 index 0000000000..37f4cd10ee --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/empty/empty.proto @@ -0,0 +1,53 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/empty"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +// The JSON representation for `Empty` is empty JSON object `{}`. +message Empty {} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go b/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go new file mode 100644 index 0000000000..197042ed52 --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.pb.go @@ -0,0 +1,382 @@ +// Code generated by protoc-gen-go. +// source: github.com/golang/protobuf/ptypes/struct/struct.proto +// DO NOT EDIT! + +/* +Package structpb is a generated protocol buffer package. + +It is generated from these files: + github.com/golang/protobuf/ptypes/struct/struct.proto + +It has these top-level messages: + Struct + Value + ListValue +*/ +package structpb + +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 + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +type NullValue int32 + +const ( + // Null value. + NullValue_NULL_VALUE NullValue = 0 +) + +var NullValue_name = map[int32]string{ + 0: "NULL_VALUE", +} +var NullValue_value = map[string]int32{ + "NULL_VALUE": 0, +} + +func (x NullValue) String() string { + return proto.EnumName(NullValue_name, int32(x)) +} +func (NullValue) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (NullValue) XXX_WellKnownType() string { return "NullValue" } + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +type Struct struct { + // Unordered map of dynamically typed values. + Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` +} + +func (m *Struct) Reset() { *m = Struct{} } +func (m *Struct) String() string { return proto.CompactTextString(m) } +func (*Struct) ProtoMessage() {} +func (*Struct) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*Struct) XXX_WellKnownType() string { return "Struct" } + +func (m *Struct) GetFields() map[string]*Value { + if m != nil { + return m.Fields + } + return nil +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +type Value struct { + // The kind of value. + // + // Types that are valid to be assigned to Kind: + // *Value_NullValue + // *Value_NumberValue + // *Value_StringValue + // *Value_BoolValue + // *Value_StructValue + // *Value_ListValue + Kind isValue_Kind `protobuf_oneof:"kind"` +} + +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{1} } +func (*Value) XXX_WellKnownType() string { return "Value" } + +type isValue_Kind interface { + isValue_Kind() +} + +type Value_NullValue struct { + NullValue NullValue `protobuf:"varint,1,opt,name=null_value,json=nullValue,enum=google.protobuf.NullValue,oneof"` +} +type Value_NumberValue struct { + NumberValue float64 `protobuf:"fixed64,2,opt,name=number_value,json=numberValue,oneof"` +} +type Value_StringValue struct { + StringValue string `protobuf:"bytes,3,opt,name=string_value,json=stringValue,oneof"` +} +type Value_BoolValue struct { + BoolValue bool `protobuf:"varint,4,opt,name=bool_value,json=boolValue,oneof"` +} +type Value_StructValue struct { + StructValue *Struct `protobuf:"bytes,5,opt,name=struct_value,json=structValue,oneof"` +} +type Value_ListValue struct { + ListValue *ListValue `protobuf:"bytes,6,opt,name=list_value,json=listValue,oneof"` +} + +func (*Value_NullValue) isValue_Kind() {} +func (*Value_NumberValue) isValue_Kind() {} +func (*Value_StringValue) isValue_Kind() {} +func (*Value_BoolValue) isValue_Kind() {} +func (*Value_StructValue) isValue_Kind() {} +func (*Value_ListValue) isValue_Kind() {} + +func (m *Value) GetKind() isValue_Kind { + if m != nil { + return m.Kind + } + return nil +} + +func (m *Value) GetNullValue() NullValue { + if x, ok := m.GetKind().(*Value_NullValue); ok { + return x.NullValue + } + return NullValue_NULL_VALUE +} + +func (m *Value) GetNumberValue() float64 { + if x, ok := m.GetKind().(*Value_NumberValue); ok { + return x.NumberValue + } + return 0 +} + +func (m *Value) GetStringValue() string { + if x, ok := m.GetKind().(*Value_StringValue); ok { + return x.StringValue + } + return "" +} + +func (m *Value) GetBoolValue() bool { + if x, ok := m.GetKind().(*Value_BoolValue); ok { + return x.BoolValue + } + return false +} + +func (m *Value) GetStructValue() *Struct { + if x, ok := m.GetKind().(*Value_StructValue); ok { + return x.StructValue + } + return nil +} + +func (m *Value) GetListValue() *ListValue { + if x, ok := m.GetKind().(*Value_ListValue); ok { + return x.ListValue + } + return nil +} + +// XXX_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_NumberValue)(nil), + (*Value_StringValue)(nil), + (*Value_BoolValue)(nil), + (*Value_StructValue)(nil), + (*Value_ListValue)(nil), + } +} + +func _Value_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*Value) + // kind + switch x := m.Kind.(type) { + case *Value_NullValue: + b.EncodeVarint(1<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.NullValue)) + case *Value_NumberValue: + b.EncodeVarint(2<<3 | proto.WireFixed64) + b.EncodeFixed64(math.Float64bits(x.NumberValue)) + case *Value_StringValue: + b.EncodeVarint(3<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StringValue) + case *Value_BoolValue: + t := uint64(0) + if x.BoolValue { + t = 1 + } + b.EncodeVarint(4<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *Value_StructValue: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.StructValue); err != nil { + return err + } + case *Value_ListValue: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.ListValue); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("Value.Kind 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: // kind.null_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Kind = &Value_NullValue{NullValue(x)} + return true, err + case 2: // kind.number_value + if wire != proto.WireFixed64 { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeFixed64() + m.Kind = &Value_NumberValue{math.Float64frombits(x)} + return true, err + case 3: // kind.string_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.Kind = &Value_StringValue{x} + return true, err + case 4: // kind.bool_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.Kind = &Value_BoolValue{x != 0} + return true, err + case 5: // kind.struct_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Struct) + err := b.DecodeMessage(msg) + m.Kind = &Value_StructValue{msg} + return true, err + case 6: // kind.list_value + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ListValue) + err := b.DecodeMessage(msg) + m.Kind = &Value_ListValue{msg} + return true, err + default: + return false, nil + } +} + +func _Value_OneofSizer(msg proto.Message) (n int) { + m := msg.(*Value) + // kind + switch x := m.Kind.(type) { + case *Value_NullValue: + n += proto.SizeVarint(1<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.NullValue)) + case *Value_NumberValue: + 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_BoolValue: + n += proto.SizeVarint(4<<3 | proto.WireVarint) + n += 1 + case *Value_StructValue: + s := proto.Size(x.StructValue) + n += proto.SizeVarint(5<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *Value_ListValue: + s := proto.Size(x.ListValue) + 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 +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +type ListValue struct { + // Repeated field of dynamically typed values. + Values []*Value `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"` +} + +func (m *ListValue) Reset() { *m = ListValue{} } +func (m *ListValue) String() string { return proto.CompactTextString(m) } +func (*ListValue) ProtoMessage() {} +func (*ListValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*ListValue) XXX_WellKnownType() string { return "ListValue" } + +func (m *ListValue) GetValues() []*Value { + if m != nil { + return m.Values + } + return nil +} + +func init() { + proto.RegisterType((*Struct)(nil), "google.protobuf.Struct") + proto.RegisterType((*Value)(nil), "google.protobuf.Value") + proto.RegisterType((*ListValue)(nil), "google.protobuf.ListValue") + proto.RegisterEnum("google.protobuf.NullValue", NullValue_name, NullValue_value) +} + +func init() { + proto.RegisterFile("github.com/golang/protobuf/ptypes/struct/struct.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 416 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x8b, 0xd3, 0x40, + 0x14, 0x80, 0x3b, 0xc9, 0x36, 0x98, 0x17, 0x59, 0x97, 0x11, 0xb4, 0xac, 0xa0, 0xa1, 0x7b, 0x09, + 0x22, 0x09, 0x56, 0x04, 0x31, 0x5e, 0x0c, 0xac, 0xbb, 0x60, 0x58, 0x62, 0x74, 0x57, 0xf0, 0x52, + 0x9a, 0x34, 0x8d, 0xa1, 0xd3, 0x99, 0x90, 0xcc, 0x28, 0x3d, 0xfa, 0x2f, 0x3c, 0x8a, 0x47, 0x8f, + 0xfe, 0x42, 0x99, 0x99, 0x24, 0x4a, 0x4b, 0xc1, 0xd3, 0xf4, 0xbd, 0xf9, 0xde, 0x37, 0xef, 0xbd, + 0x06, 0x9e, 0x97, 0x15, 0xff, 0x2c, 0x32, 0x3f, 0x67, 0x9b, 0xa0, 0x64, 0x64, 0x41, 0xcb, 0xa0, + 0x6e, 0x18, 0x67, 0x99, 0x58, 0x05, 0x35, 0xdf, 0xd6, 0x45, 0x1b, 0xb4, 0xbc, 0x11, 0x39, 0xef, + 0x0e, 0x5f, 0xdd, 0xe2, 0x3b, 0x25, 0x63, 0x25, 0x29, 0xfc, 0x9e, 0x9d, 0x7e, 0x47, 0x60, 0xbd, + 0x57, 0x04, 0x0e, 0xc1, 0x5a, 0x55, 0x05, 0x59, 0xb6, 0x13, 0xe4, 0x9a, 0x9e, 0x33, 0x3b, 0xf3, + 0x77, 0x60, 0x5f, 0x83, 0xfe, 0x1b, 0x45, 0x9d, 0x53, 0xde, 0x6c, 0xd3, 0xae, 0xe4, 0xf4, 0x1d, + 0x38, 0xff, 0xa4, 0xf1, 0x09, 0x98, 0xeb, 0x62, 0x3b, 0x41, 0x2e, 0xf2, 0xec, 0x54, 0xfe, 0xc4, + 0x4f, 0x60, 0xfc, 0x65, 0x41, 0x44, 0x31, 0x31, 0x5c, 0xe4, 0x39, 0xb3, 0x7b, 0x7b, 0xf2, 0x1b, + 0x79, 0x9b, 0x6a, 0xe8, 0xa5, 0xf1, 0x02, 0x4d, 0x7f, 0x1b, 0x30, 0x56, 0x49, 0x1c, 0x02, 0x50, + 0x41, 0xc8, 0x5c, 0x0b, 0xa4, 0xf4, 0x78, 0x76, 0xba, 0x27, 0xb8, 0x12, 0x84, 0x28, 0xfe, 0x72, + 0x94, 0xda, 0xb4, 0x0f, 0xf0, 0x19, 0xdc, 0xa6, 0x62, 0x93, 0x15, 0xcd, 0xfc, 0xef, 0xfb, 0xe8, + 0x72, 0x94, 0x3a, 0x3a, 0x3b, 0x40, 0x2d, 0x6f, 0x2a, 0x5a, 0x76, 0x90, 0x29, 0x1b, 0x97, 0x90, + 0xce, 0x6a, 0xe8, 0x11, 0x40, 0xc6, 0x58, 0xdf, 0xc6, 0x91, 0x8b, 0xbc, 0x5b, 0xf2, 0x29, 0x99, + 0xd3, 0xc0, 0x2b, 0x65, 0x11, 0x39, 0xef, 0x90, 0xb1, 0x1a, 0xf5, 0xfe, 0x81, 0x3d, 0x76, 0x7a, + 0x91, 0xf3, 0x61, 0x4a, 0x52, 0xb5, 0x7d, 0xad, 0xa5, 0x6a, 0xf7, 0xa7, 0x8c, 0xab, 0x96, 0x0f, + 0x53, 0x92, 0x3e, 0x88, 0x2c, 0x38, 0x5a, 0x57, 0x74, 0x39, 0x0d, 0xc1, 0x1e, 0x08, 0xec, 0x83, + 0xa5, 0x64, 0xfd, 0x3f, 0x7a, 0x68, 0xe9, 0x1d, 0xf5, 0xf8, 0x01, 0xd8, 0xc3, 0x12, 0xf1, 0x31, + 0xc0, 0xd5, 0x75, 0x1c, 0xcf, 0x6f, 0x5e, 0xc7, 0xd7, 0xe7, 0x27, 0xa3, 0xe8, 0x1b, 0x82, 0xbb, + 0x39, 0xdb, 0xec, 0x2a, 0x22, 0x47, 0x4f, 0x93, 0xc8, 0x38, 0x41, 0x9f, 0x9e, 0xfe, 0xef, 0x87, + 0x19, 0xea, 0xa3, 0xce, 0x7e, 0x20, 0xf4, 0xd3, 0x30, 0x2f, 0x92, 0xe8, 0x97, 0xf1, 0xf0, 0x42, + 0xcb, 0x93, 0xbe, 0xbf, 0x8f, 0x05, 0x21, 0x6f, 0x29, 0xfb, 0x4a, 0x3f, 0xc8, 0xca, 0xcc, 0x52, + 0xaa, 0x67, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xbc, 0xcf, 0x6d, 0x50, 0xfe, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto b/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto new file mode 100644 index 0000000000..beeba81188 --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/struct/struct.proto @@ -0,0 +1,96 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "github.com/golang/protobuf/ptypes/struct;structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of that +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go b/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go new file mode 100644 index 0000000000..5e52a81c7b --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.pb.go @@ -0,0 +1,200 @@ +// Code generated by protoc-gen-go. +// source: github.com/golang/protobuf/ptypes/wrappers/wrappers.proto +// DO NOT EDIT! + +/* +Package wrappers is a generated protocol buffer package. + +It is generated from these files: + github.com/golang/protobuf/ptypes/wrappers/wrappers.proto + +It has these top-level messages: + DoubleValue + FloatValue + Int64Value + UInt64Value + Int32Value + UInt32Value + BoolValue + StringValue + BytesValue +*/ +package wrappers + +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 + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +type DoubleValue struct { + // The double value. + Value float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"` +} + +func (m *DoubleValue) Reset() { *m = DoubleValue{} } +func (m *DoubleValue) String() string { return proto.CompactTextString(m) } +func (*DoubleValue) ProtoMessage() {} +func (*DoubleValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*DoubleValue) XXX_WellKnownType() string { return "DoubleValue" } + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +type FloatValue struct { + // The float value. + Value float32 `protobuf:"fixed32,1,opt,name=value" json:"value,omitempty"` +} + +func (m *FloatValue) Reset() { *m = FloatValue{} } +func (m *FloatValue) String() string { return proto.CompactTextString(m) } +func (*FloatValue) ProtoMessage() {} +func (*FloatValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*FloatValue) XXX_WellKnownType() string { return "FloatValue" } + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +type Int64Value struct { + // The int64 value. + Value int64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` +} + +func (m *Int64Value) Reset() { *m = Int64Value{} } +func (m *Int64Value) String() string { return proto.CompactTextString(m) } +func (*Int64Value) ProtoMessage() {} +func (*Int64Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*Int64Value) XXX_WellKnownType() string { return "Int64Value" } + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +type UInt64Value struct { + // The uint64 value. + Value uint64 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` +} + +func (m *UInt64Value) Reset() { *m = UInt64Value{} } +func (m *UInt64Value) String() string { return proto.CompactTextString(m) } +func (*UInt64Value) ProtoMessage() {} +func (*UInt64Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } +func (*UInt64Value) XXX_WellKnownType() string { return "UInt64Value" } + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +type Int32Value struct { + // The int32 value. + Value int32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` +} + +func (m *Int32Value) Reset() { *m = Int32Value{} } +func (m *Int32Value) String() string { return proto.CompactTextString(m) } +func (*Int32Value) ProtoMessage() {} +func (*Int32Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*Int32Value) XXX_WellKnownType() string { return "Int32Value" } + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +type UInt32Value struct { + // The uint32 value. + Value uint32 `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` +} + +func (m *UInt32Value) Reset() { *m = UInt32Value{} } +func (m *UInt32Value) String() string { return proto.CompactTextString(m) } +func (*UInt32Value) ProtoMessage() {} +func (*UInt32Value) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } +func (*UInt32Value) XXX_WellKnownType() string { return "UInt32Value" } + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +type BoolValue struct { + // The bool value. + Value bool `protobuf:"varint,1,opt,name=value" json:"value,omitempty"` +} + +func (m *BoolValue) Reset() { *m = BoolValue{} } +func (m *BoolValue) String() string { return proto.CompactTextString(m) } +func (*BoolValue) ProtoMessage() {} +func (*BoolValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } +func (*BoolValue) XXX_WellKnownType() string { return "BoolValue" } + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +type StringValue struct { + // The string value. + Value string `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"` +} + +func (m *StringValue) Reset() { *m = StringValue{} } +func (m *StringValue) String() string { return proto.CompactTextString(m) } +func (*StringValue) ProtoMessage() {} +func (*StringValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } +func (*StringValue) XXX_WellKnownType() string { return "StringValue" } + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +type BytesValue struct { + // The bytes value. + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *BytesValue) Reset() { *m = BytesValue{} } +func (m *BytesValue) String() string { return proto.CompactTextString(m) } +func (*BytesValue) ProtoMessage() {} +func (*BytesValue) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } +func (*BytesValue) XXX_WellKnownType() string { return "BytesValue" } + +func init() { + proto.RegisterType((*DoubleValue)(nil), "google.protobuf.DoubleValue") + proto.RegisterType((*FloatValue)(nil), "google.protobuf.FloatValue") + proto.RegisterType((*Int64Value)(nil), "google.protobuf.Int64Value") + proto.RegisterType((*UInt64Value)(nil), "google.protobuf.UInt64Value") + proto.RegisterType((*Int32Value)(nil), "google.protobuf.Int32Value") + proto.RegisterType((*UInt32Value)(nil), "google.protobuf.UInt32Value") + proto.RegisterType((*BoolValue)(nil), "google.protobuf.BoolValue") + proto.RegisterType((*StringValue)(nil), "google.protobuf.StringValue") + proto.RegisterType((*BytesValue)(nil), "google.protobuf.BytesValue") +} + +func init() { + proto.RegisterFile("github.com/golang/protobuf/ptypes/wrappers/wrappers.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 260 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x2f, 0x28, + 0xca, 0x2f, 0xc9, 0x4f, 0x2a, 0x4d, 0xd3, 0x2f, 0x28, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2f, 0x2f, + 0x4a, 0x2c, 0x28, 0x48, 0x2d, 0x42, 0x30, 0xf4, 0xc0, 0x2a, 0x84, 0xf8, 0xd3, 0xf3, 0xf3, 0xd3, + 0x73, 0x52, 0xf5, 0x60, 0xea, 0x95, 0x94, 0xb9, 0xb8, 0x5d, 0xf2, 0x4b, 0x93, 0x72, 0x52, 0xc3, + 0x12, 0x73, 0x4a, 0x53, 0x85, 0x44, 0xb8, 0x58, 0xcb, 0x40, 0x0c, 0x09, 0x46, 0x05, 0x46, 0x0d, + 0xc6, 0x20, 0x08, 0x47, 0x49, 0x89, 0x8b, 0xcb, 0x2d, 0x27, 0x3f, 0xb1, 0x04, 0x8b, 0x1a, 0x26, + 0x24, 0x35, 0x9e, 0x79, 0x25, 0x66, 0x26, 0x58, 0xd4, 0x30, 0xc3, 0xd4, 0x28, 0x73, 0x71, 0x87, + 0xe2, 0x52, 0xc4, 0x82, 0x6a, 0x90, 0xb1, 0x11, 0x16, 0x35, 0xac, 0x68, 0x06, 0x61, 0x55, 0xc4, + 0x0b, 0x53, 0xa4, 0xc8, 0xc5, 0xe9, 0x94, 0x9f, 0x9f, 0x83, 0x45, 0x09, 0x07, 0x92, 0x39, 0xc1, + 0x25, 0x45, 0x99, 0x79, 0xe9, 0x58, 0x14, 0x71, 0x22, 0x39, 0xc8, 0xa9, 0xb2, 0x24, 0xb5, 0x18, + 0x8b, 0x1a, 0x1e, 0xa8, 0x1a, 0xa7, 0x7a, 0x2e, 0xe1, 0xe4, 0xfc, 0x5c, 0x3d, 0xb4, 0xd0, 0x75, + 0xe2, 0x0d, 0x87, 0x06, 0x7f, 0x00, 0x48, 0x24, 0x80, 0x31, 0x4a, 0x8b, 0xf8, 0xa8, 0x5b, 0xc0, + 0xc8, 0xf8, 0x83, 0x91, 0x71, 0x11, 0x13, 0xb3, 0x7b, 0x80, 0xd3, 0x2a, 0x26, 0x39, 0x77, 0x88, + 0xd1, 0x01, 0x50, 0xd5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x20, + 0x5d, 0x49, 0x6c, 0x60, 0x63, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa9, 0xdf, 0x64, 0x4b, + 0x1c, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto b/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto new file mode 100644 index 0000000000..4828ad9ae9 --- /dev/null +++ b/components/engine/vendor/github.com/golang/protobuf/ptypes/wrappers/wrappers.proto @@ -0,0 +1,119 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "github.com/golang/protobuf/ptypes/wrappers"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} diff --git a/components/engine/vendor/github.com/googleapis/gax-go/LICENSE b/components/engine/vendor/github.com/googleapis/gax-go/LICENSE new file mode 100644 index 0000000000..6d16b6578a --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/LICENSE @@ -0,0 +1,27 @@ +Copyright 2016, Google Inc. +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/components/engine/vendor/github.com/googleapis/gax-go/call_option.go b/components/engine/vendor/github.com/googleapis/gax-go/call_option.go new file mode 100644 index 0000000000..4ba1cdfe80 --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/call_option.go @@ -0,0 +1,136 @@ +// Copyright 2016, Google Inc. +// 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. + +package gax + +import ( + "math/rand" + "time" + + "google.golang.org/grpc" + "google.golang.org/grpc/codes" +) + +// CallOption is an option used by Invoke to control behaviors of RPC calls. +// CallOption works by modifying relevant fields of CallSettings. +type CallOption interface { + // Resolve applies the option by modifying cs. + Resolve(cs *CallSettings) +} + +// Retryer is used by Invoke to determine retry behavior. +type Retryer interface { + // Retry reports whether a request should be retriedand how long to pause before retrying + // if the previous attempt returned with err. Invoke never calls Retry with nil error. + Retry(err error) (pause time.Duration, shouldRetry bool) +} + +type retryerOption func() Retryer + +func (o retryerOption) Resolve(s *CallSettings) { + s.Retry = o +} + +// WithRetry sets CallSettings.Retry to fn. +func WithRetry(fn func() Retryer) CallOption { + return retryerOption(fn) +} + +// OnCodes returns a Retryer that retries if and only if +// the previous attempt returns a GRPC error whose error code is stored in cc. +// Pause times between retries are specified by bo. +// +// bo is only used for its parameters; each Retryer has its own copy. +func OnCodes(cc []codes.Code, bo Backoff) Retryer { + return &boRetryer{ + backoff: bo, + codes: append([]codes.Code(nil), cc...), + } +} + +type boRetryer struct { + backoff Backoff + codes []codes.Code +} + +func (r *boRetryer) Retry(err error) (time.Duration, bool) { + c := grpc.Code(err) + for _, rc := range r.codes { + if c == rc { + return r.backoff.Pause(), true + } + } + return 0, false +} + +// Backoff implements exponential backoff. +// The wait time between retries is a random value between 0 and the "retry envelope". +// The envelope starts at Initial and increases by the factor of Multiplier every retry, +// but is capped at Max. +type Backoff struct { + // Initial is the initial value of the retry envelope, defaults to 1 second. + Initial time.Duration + + // Max is the maximum value of the retry envelope, defaults to 30 seconds. + Max time.Duration + + // Multiplier is the factor by which the retry envelope increases. + // It should be greater than 1 and defaults to 2. + Multiplier float64 + + // cur is the current retry envelope + cur time.Duration +} + +func (bo *Backoff) Pause() time.Duration { + if bo.Initial == 0 { + bo.Initial = time.Second + } + if bo.cur == 0 { + bo.cur = bo.Initial + } + if bo.Max == 0 { + bo.Max = 30 * time.Second + } + if bo.Multiplier < 1 { + bo.Multiplier = 2 + } + d := time.Duration(rand.Int63n(int64(bo.cur))) + bo.cur = time.Duration(float64(bo.cur) * bo.Multiplier) + if bo.cur > bo.Max { + bo.cur = bo.Max + } + return d +} + +type CallSettings struct { + // Retry returns a Retryer to be used to control retry logic of a method call. + // If Retry is nil or the returned Retryer is nil, the call will not be retried. + Retry func() Retryer +} diff --git a/components/engine/vendor/github.com/googleapis/gax-go/gax.go b/components/engine/vendor/github.com/googleapis/gax-go/gax.go new file mode 100644 index 0000000000..5ebedff0d0 --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/gax.go @@ -0,0 +1,40 @@ +// Copyright 2016, Google Inc. +// 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. + +// Package gax contains a set of modules which aid the development of APIs +// for clients and servers based on gRPC and Google API conventions. +// +// Application code will rarely need to use this library directly. +// However, code generated automatically from API definition files can use it +// to simplify code generation and to provide more convenient and idiomatic API surfaces. +// +// This project is currently experimental and not supported. +package gax + +const Version = "0.1.0" diff --git a/components/engine/vendor/github.com/googleapis/gax-go/invoke.go b/components/engine/vendor/github.com/googleapis/gax-go/invoke.go new file mode 100644 index 0000000000..d2134e1df1 --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/invoke.go @@ -0,0 +1,90 @@ +// Copyright 2016, Google Inc. +// 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. + +package gax + +import ( + "time" + + "golang.org/x/net/context" +) + +// A user defined call stub. +type APICall func(context.Context) error + +// Invoke calls the given APICall, +// performing retries as specified by opts, if any. +func Invoke(ctx context.Context, call APICall, opts ...CallOption) error { + var settings CallSettings + for _, opt := range opts { + opt.Resolve(&settings) + } + return invoke(ctx, call, settings, Sleep) +} + +// Sleep is similar to time.Sleep, but it can be interrupted by ctx.Done() closing. +// If interrupted, Sleep returns ctx.Err(). +func Sleep(ctx context.Context, d time.Duration) error { + t := time.NewTimer(d) + select { + case <-ctx.Done(): + t.Stop() + return ctx.Err() + case <-t.C: + return nil + } +} + +type sleeper func(ctx context.Context, d time.Duration) error + +// invoke implements Invoke, taking an additional sleeper argument for testing. +func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper) error { + var retryer Retryer + for { + err := call(ctx) + if err == nil { + return nil + } + if settings.Retry == nil { + return err + } + if retryer == nil { + if r := settings.Retry(); r != nil { + retryer = r + } else { + return err + } + } + if d, ok := retryer.Retry(err); !ok { + return err + } else if err = sp(ctx, d); err != nil { + return err + } + } +} diff --git a/components/engine/vendor/github.com/googleapis/gax-go/path_template.go b/components/engine/vendor/github.com/googleapis/gax-go/path_template.go new file mode 100644 index 0000000000..41bda94cb6 --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/path_template.go @@ -0,0 +1,176 @@ +// Copyright 2016, Google Inc. +// 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. + +package gax + +import ( + "errors" + "fmt" + "strings" +) + +type matcher interface { + match([]string) (int, error) + String() string +} + +type segment struct { + matcher + name string +} + +type labelMatcher string + +func (ls labelMatcher) match(segments []string) (int, error) { + if len(segments) == 0 { + return 0, fmt.Errorf("expected %s but no more segments found", ls) + } + if segments[0] != string(ls) { + return 0, fmt.Errorf("expected %s but got %s", ls, segments[0]) + } + return 1, nil +} + +func (ls labelMatcher) String() string { + return string(ls) +} + +type wildcardMatcher int + +func (wm wildcardMatcher) match(segments []string) (int, error) { + if len(segments) == 0 { + return 0, errors.New("no more segments found") + } + return 1, nil +} + +func (wm wildcardMatcher) String() string { + return "*" +} + +type pathWildcardMatcher int + +func (pwm pathWildcardMatcher) match(segments []string) (int, error) { + length := len(segments) - int(pwm) + if length <= 0 { + return 0, errors.New("not sufficient segments are supplied for path wildcard") + } + return length, nil +} + +func (pwm pathWildcardMatcher) String() string { + return "**" +} + +type ParseError struct { + Pos int + Template string + Message string +} + +func (pe ParseError) Error() string { + return fmt.Sprintf("at %d of template '%s', %s", pe.Pos, pe.Template, pe.Message) +} + +// PathTemplate manages the template to build and match with paths used +// by API services. It holds a template and variable names in it, and +// it can extract matched patterns from a path string or build a path +// string from a binding. +// +// See http.proto in github.com/googleapis/googleapis/ for the details of +// the template syntax. +type PathTemplate struct { + segments []segment +} + +// NewPathTemplate parses a path template, and returns a PathTemplate +// instance if successful. +func NewPathTemplate(template string) (*PathTemplate, error) { + return parsePathTemplate(template) +} + +// MustCompilePathTemplate is like NewPathTemplate but panics if the +// expression cannot be parsed. It simplifies safe initialization of +// global variables holding compiled regular expressions. +func MustCompilePathTemplate(template string) *PathTemplate { + pt, err := NewPathTemplate(template) + if err != nil { + panic(err) + } + return pt +} + +// Match attempts to match the given path with the template, and returns +// the mapping of the variable name to the matched pattern string. +func (pt *PathTemplate) Match(path string) (map[string]string, error) { + paths := strings.Split(path, "/") + values := map[string]string{} + for _, segment := range pt.segments { + length, err := segment.match(paths) + if err != nil { + return nil, err + } + if segment.name != "" { + value := strings.Join(paths[:length], "/") + if oldValue, ok := values[segment.name]; ok { + values[segment.name] = oldValue + "/" + value + } else { + values[segment.name] = value + } + } + paths = paths[length:] + } + if len(paths) != 0 { + return nil, fmt.Errorf("Trailing path %s remains after the matching", strings.Join(paths, "/")) + } + return values, nil +} + +// Render creates a path string from its template and the binding from +// the variable name to the value. +func (pt *PathTemplate) Render(binding map[string]string) (string, error) { + result := make([]string, 0, len(pt.segments)) + var lastVariableName string + for _, segment := range pt.segments { + name := segment.name + if lastVariableName != "" && name == lastVariableName { + continue + } + lastVariableName = name + if name == "" { + result = append(result, segment.String()) + } else if value, ok := binding[name]; ok { + result = append(result, value) + } else { + return "", fmt.Errorf("%s is not found", name) + } + } + built := strings.Join(result, "/") + return built, nil +} diff --git a/components/engine/vendor/github.com/googleapis/gax-go/path_template_parser.go b/components/engine/vendor/github.com/googleapis/gax-go/path_template_parser.go new file mode 100644 index 0000000000..79c8e759c9 --- /dev/null +++ b/components/engine/vendor/github.com/googleapis/gax-go/path_template_parser.go @@ -0,0 +1,227 @@ +// Copyright 2016, Google Inc. +// 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. + +package gax + +import ( + "fmt" + "io" + "strings" +) + +// This parser follows the syntax of path templates, from +// https://github.com/googleapis/googleapis/blob/master/google/api/http.proto. +// The differences are that there is no custom verb, we allow the initial slash +// to be absent, and that we are not strict as +// https://tools.ietf.org/html/rfc6570 about the characters in identifiers and +// literals. + +type pathTemplateParser struct { + r *strings.Reader + runeCount int // the number of the current rune in the original string + nextVar int // the number to use for the next unnamed variable + seenName map[string]bool // names we've seen already + seenPathWildcard bool // have we seen "**" already? +} + +func parsePathTemplate(template string) (pt *PathTemplate, err error) { + p := &pathTemplateParser{ + r: strings.NewReader(template), + seenName: map[string]bool{}, + } + + // Handle panics with strings like errors. + // See pathTemplateParser.error, below. + defer func() { + if x := recover(); x != nil { + errmsg, ok := x.(errString) + if !ok { + panic(x) + } + pt = nil + err = ParseError{p.runeCount, template, string(errmsg)} + } + }() + + segs := p.template() + // If there is a path wildcard, set its length. We can't do this + // until we know how many segments we've got all together. + for i, seg := range segs { + if _, ok := seg.matcher.(pathWildcardMatcher); ok { + segs[i].matcher = pathWildcardMatcher(len(segs) - i - 1) + break + } + } + return &PathTemplate{segments: segs}, nil + +} + +// Used to indicate errors "thrown" by this parser. We don't use string because +// many parts of the standard library panic with strings. +type errString string + +// Terminates parsing immediately with an error. +func (p *pathTemplateParser) error(msg string) { + panic(errString(msg)) +} + +// Template = [ "/" ] Segments +func (p *pathTemplateParser) template() []segment { + var segs []segment + if p.consume('/') { + // Initial '/' needs an initial empty matcher. + segs = append(segs, segment{matcher: labelMatcher("")}) + } + return append(segs, p.segments("")...) +} + +// Segments = Segment { "/" Segment } +func (p *pathTemplateParser) segments(name string) []segment { + var segs []segment + for { + subsegs := p.segment(name) + segs = append(segs, subsegs...) + if !p.consume('/') { + break + } + } + return segs +} + +// Segment = "*" | "**" | LITERAL | Variable +func (p *pathTemplateParser) segment(name string) []segment { + if p.consume('*') { + if name == "" { + name = fmt.Sprintf("$%d", p.nextVar) + p.nextVar++ + } + if p.consume('*') { + if p.seenPathWildcard { + p.error("multiple '**' disallowed") + } + p.seenPathWildcard = true + // We'll change 0 to the right number at the end. + return []segment{{name: name, matcher: pathWildcardMatcher(0)}} + } + return []segment{{name: name, matcher: wildcardMatcher(0)}} + } + if p.consume('{') { + if name != "" { + p.error("recursive named bindings are not allowed") + } + return p.variable() + } + return []segment{{name: name, matcher: labelMatcher(p.literal())}} +} + +// Variable = "{" FieldPath [ "=" Segments ] "}" +// "{" is already consumed. +func (p *pathTemplateParser) variable() []segment { + // Simplification: treat FieldPath as LITERAL, instead of IDENT { '.' IDENT } + name := p.literal() + if p.seenName[name] { + p.error(name + " appears multiple times") + } + p.seenName[name] = true + var segs []segment + if p.consume('=') { + segs = p.segments(name) + } else { + // "{var}" is equivalent to "{var=*}" + segs = []segment{{name: name, matcher: wildcardMatcher(0)}} + } + if !p.consume('}') { + p.error("expected '}'") + } + return segs +} + +// A literal is any sequence of characters other than a few special ones. +// The list of stop characters is not quite the same as in the template RFC. +func (p *pathTemplateParser) literal() string { + lit := p.consumeUntil("/*}{=") + if lit == "" { + p.error("empty literal") + } + return lit +} + +// Read runes until EOF or one of the runes in stopRunes is encountered. +// If the latter, unread the stop rune. Return the accumulated runes as a string. +func (p *pathTemplateParser) consumeUntil(stopRunes string) string { + var runes []rune + for { + r, ok := p.readRune() + if !ok { + break + } + if strings.IndexRune(stopRunes, r) >= 0 { + p.unreadRune() + break + } + runes = append(runes, r) + } + return string(runes) +} + +// If the next rune is r, consume it and return true. +// Otherwise, leave the input unchanged and return false. +func (p *pathTemplateParser) consume(r rune) bool { + rr, ok := p.readRune() + if !ok { + return false + } + if r == rr { + return true + } + p.unreadRune() + return false +} + +// Read the next rune from the input. Return it. +// The second return value is false at EOF. +func (p *pathTemplateParser) readRune() (rune, bool) { + r, _, err := p.r.ReadRune() + if err == io.EOF { + return r, false + } + if err != nil { + p.error(err.Error()) + } + p.runeCount++ + return r, true +} + +// Put the last rune that was read back on the input. +func (p *pathTemplateParser) unreadRune() { + if err := p.r.UnreadRune(); err != nil { + p.error(err.Error()) + } + p.runeCount-- +} diff --git a/components/engine/vendor/golang.org/x/oauth2/google/appengine.go b/components/engine/vendor/golang.org/x/oauth2/google/appengine.go index dc993efb5e..4243f4cb96 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/appengine.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/appengine.go @@ -20,6 +20,9 @@ var appengineVM bool // Set at init time by appengine_hook.go. If nil, we're not on App Engine. var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) +// Set at init time by appengine_hook.go. If nil, we're not on App Engine. +var appengineAppIDFunc func(c context.Context) string + // AppEngineTokenSource returns a token source that fetches tokens // issued to the current App Engine application's service account. // If you are implementing a 3-legged OAuth 2.0 flow on App Engine diff --git a/components/engine/vendor/golang.org/x/oauth2/google/appengine_hook.go b/components/engine/vendor/golang.org/x/oauth2/google/appengine_hook.go index 4f42c8b343..6f66411412 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/appengine_hook.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/appengine_hook.go @@ -10,4 +10,5 @@ import "google.golang.org/appengine" func init() { appengineTokenFunc = appengine.AccessToken + appengineAppIDFunc = appengine.AppID } diff --git a/components/engine/vendor/golang.org/x/oauth2/google/appenginevm_hook.go b/components/engine/vendor/golang.org/x/oauth2/google/appenginevm_hook.go index 633611cc3a..10747801f3 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/appenginevm_hook.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/appenginevm_hook.go @@ -11,4 +11,5 @@ import "google.golang.org/appengine" func init() { appengineVM = true appengineTokenFunc = appengine.AccessToken + appengineAppIDFunc = appengine.AppID } diff --git a/components/engine/vendor/golang.org/x/oauth2/google/default.go b/components/engine/vendor/golang.org/x/oauth2/google/default.go index b952362977..b45e796165 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/default.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/default.go @@ -6,7 +6,6 @@ package google import ( "encoding/json" - "errors" "fmt" "io/ioutil" "net/http" @@ -14,22 +13,21 @@ import ( "path/filepath" "runtime" + "cloud.google.com/go/compute/metadata" "golang.org/x/net/context" "golang.org/x/oauth2" - "golang.org/x/oauth2/jwt" - "google.golang.org/cloud/compute/metadata" ) +// DefaultCredentials holds "Application Default Credentials". +// For more details, see: +// https://developers.google.com/accounts/docs/application-default-credentials +type DefaultCredentials struct { + ProjectID string // may be empty + TokenSource oauth2.TokenSource +} + // DefaultClient returns an HTTP Client that uses the // DefaultTokenSource to obtain authentication credentials. -// -// This client should be used when developing services -// that run on Google App Engine or Google Compute Engine -// and use "Application Default Credentials." -// -// For more details, see: -// https://developers.google.com/accounts/docs/application-default-credentials -// func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { ts, err := DefaultTokenSource(ctx, scope...) if err != nil { @@ -38,8 +36,18 @@ func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { return oauth2.NewClient(ctx, ts), nil } -// DefaultTokenSource is a token source that uses +// DefaultTokenSource returns the token source for // "Application Default Credentials". +// It is a shortcut for FindDefaultCredentials(ctx, scope).TokenSource. +func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error) { + creds, err := FindDefaultCredentials(ctx, scope...) + if err != nil { + return nil, err + } + return creds.TokenSource, nil +} + +// FindDefaultCredentials searches for "Application Default Credentials". // // It looks for credentials in the following places, // preferring the first location found: @@ -53,45 +61,40 @@ func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { // 4. On Google Compute Engine and Google App Engine Managed VMs, it fetches // credentials from the metadata server. // (In this final case any provided scopes are ignored.) -// -// For more details, see: -// https://developers.google.com/accounts/docs/application-default-credentials -// -func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error) { +func FindDefaultCredentials(ctx context.Context, scope ...string) (*DefaultCredentials, error) { // First, try the environment variable. const envVar = "GOOGLE_APPLICATION_CREDENTIALS" if filename := os.Getenv(envVar); filename != "" { - ts, err := tokenSourceFromFile(ctx, filename, scope) + creds, err := readCredentialsFile(ctx, filename, scope) if err != nil { return nil, fmt.Errorf("google: error getting credentials using %v environment variable: %v", envVar, err) } - return ts, nil + return creds, nil } // Second, try a well-known file. filename := wellKnownFile() - _, err := os.Stat(filename) - if err == nil { - ts, err2 := tokenSourceFromFile(ctx, filename, scope) - if err2 == nil { - return ts, nil - } - err = err2 - } else if os.IsNotExist(err) { - err = nil // ignore this error - } - if err != nil { + if creds, err := readCredentialsFile(ctx, filename, scope); err == nil { + return creds, nil + } else if !os.IsNotExist(err) { return nil, fmt.Errorf("google: error getting credentials using well-known file (%v): %v", filename, err) } // Third, if we're on Google App Engine use those credentials. if appengineTokenFunc != nil && !appengineVM { - return AppEngineTokenSource(ctx, scope...), nil + return &DefaultCredentials{ + ProjectID: appengineAppIDFunc(ctx), + TokenSource: AppEngineTokenSource(ctx, scope...), + }, nil } // Fourth, if we're on Google Compute Engine use the metadata server. if metadata.OnGCE() { - return ComputeTokenSource(""), nil + id, _ := metadata.ProjectID() + return &DefaultCredentials{ + ProjectID: id, + TokenSource: ComputeTokenSource(""), + }, nil } // None are found; return helpful error. @@ -107,49 +110,21 @@ func wellKnownFile() string { return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", f) } -func tokenSourceFromFile(ctx context.Context, filename string, scopes []string) (oauth2.TokenSource, error) { +func readCredentialsFile(ctx context.Context, filename string, scopes []string) (*DefaultCredentials, error) { b, err := ioutil.ReadFile(filename) if err != nil { return nil, err } - var d struct { - // Common fields - Type string - ClientID string `json:"client_id"` - - // User Credential fields - ClientSecret string `json:"client_secret"` - RefreshToken string `json:"refresh_token"` - - // Service Account fields - ClientEmail string `json:"client_email"` - PrivateKeyID string `json:"private_key_id"` - PrivateKey string `json:"private_key"` - } - if err := json.Unmarshal(b, &d); err != nil { + var f credentialsFile + if err := json.Unmarshal(b, &f); err != nil { return nil, err } - switch d.Type { - case "authorized_user": - cfg := &oauth2.Config{ - ClientID: d.ClientID, - ClientSecret: d.ClientSecret, - Scopes: append([]string{}, scopes...), // copy - Endpoint: Endpoint, - } - tok := &oauth2.Token{RefreshToken: d.RefreshToken} - return cfg.TokenSource(ctx, tok), nil - case "service_account": - cfg := &jwt.Config{ - Email: d.ClientEmail, - PrivateKey: []byte(d.PrivateKey), - Scopes: append([]string{}, scopes...), // copy - TokenURL: JWTTokenURL, - } - return cfg.TokenSource(ctx), nil - case "": - return nil, errors.New("missing 'type' field in credentials") - default: - return nil, fmt.Errorf("unknown credential type: %q", d.Type) + ts, err := f.tokenSource(ctx, append([]string(nil), scopes...)) + if err != nil { + return nil, err } + return &DefaultCredentials{ + ProjectID: f.ProjectID, + TokenSource: ts, + }, nil } diff --git a/components/engine/vendor/golang.org/x/oauth2/google/google.go b/components/engine/vendor/golang.org/x/oauth2/google/google.go index 9a3d5feb1b..66a8b0e181 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/google.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/google.go @@ -21,9 +21,10 @@ import ( "strings" "time" + "cloud.google.com/go/compute/metadata" + "golang.org/x/net/context" "golang.org/x/oauth2" "golang.org/x/oauth2/jwt" - "google.golang.org/cloud/compute/metadata" ) // Endpoint is Google's OAuth 2.0 endpoint. @@ -37,9 +38,10 @@ const JWTTokenURL = "https://accounts.google.com/o/oauth2/token" // ConfigFromJSON uses a Google Developers Console client_credentials.json // file to construct a config. -// client_credentials.json can be downloadable from https://console.developers.google.com, -// under "APIs & Auth" > "Credentials". Download the Web application credentials in the -// JSON format and provide the contents of the file as jsonKey. +// client_credentials.json can be downloaded from +// https://console.developers.google.com, under "Credentials". Download the Web +// application credentials in the JSON format and provide the contents of the +// file as jsonKey. func ConfigFromJSON(jsonKey []byte, scope ...string) (*oauth2.Config, error) { type cred struct { ClientID string `json:"client_id"` @@ -81,22 +83,77 @@ func ConfigFromJSON(jsonKey []byte, scope ...string) (*oauth2.Config, error) { // JWTConfigFromJSON uses a Google Developers service account JSON key file to read // the credentials that authorize and authenticate the requests. -// Create a service account on "Credentials" page under "APIs & Auth" for your -// project at https://console.developers.google.com to download a JSON key file. +// Create a service account on "Credentials" for your project at +// https://console.developers.google.com to download a JSON key file. func JWTConfigFromJSON(jsonKey []byte, scope ...string) (*jwt.Config, error) { - var key struct { - Email string `json:"client_email"` - PrivateKey string `json:"private_key"` - } - if err := json.Unmarshal(jsonKey, &key); err != nil { + var f credentialsFile + if err := json.Unmarshal(jsonKey, &f); err != nil { return nil, err } - return &jwt.Config{ - Email: key.Email, - PrivateKey: []byte(key.PrivateKey), - Scopes: scope, - TokenURL: JWTTokenURL, - }, nil + if f.Type != serviceAccountKey { + return nil, fmt.Errorf("google: read JWT from JSON credentials: 'type' field is %q (expected %q)", f.Type, serviceAccountKey) + } + scope = append([]string(nil), scope...) // copy + return f.jwtConfig(scope), nil +} + +// JSON key file types. +const ( + serviceAccountKey = "service_account" + userCredentialsKey = "authorized_user" +) + +// credentialsFile is the unmarshalled representation of a credentials file. +type credentialsFile struct { + Type string `json:"type"` // serviceAccountKey or userCredentialsKey + + // Service Account fields + ClientEmail string `json:"client_email"` + PrivateKeyID string `json:"private_key_id"` + PrivateKey string `json:"private_key"` + TokenURL string `json:"token_uri"` + ProjectID string `json:"project_id"` + + // User Credential fields + // (These typically come from gcloud auth.) + ClientSecret string `json:"client_secret"` + ClientID string `json:"client_id"` + RefreshToken string `json:"refresh_token"` +} + +func (f *credentialsFile) jwtConfig(scopes []string) *jwt.Config { + cfg := &jwt.Config{ + Email: f.ClientEmail, + PrivateKey: []byte(f.PrivateKey), + PrivateKeyID: f.PrivateKeyID, + Scopes: scopes, + TokenURL: f.TokenURL, + } + if cfg.TokenURL == "" { + cfg.TokenURL = JWTTokenURL + } + return cfg +} + +func (f *credentialsFile) tokenSource(ctx context.Context, scopes []string) (oauth2.TokenSource, error) { + switch f.Type { + case serviceAccountKey: + cfg := f.jwtConfig(scopes) + return cfg.TokenSource(ctx), nil + case userCredentialsKey: + cfg := &oauth2.Config{ + ClientID: f.ClientID, + ClientSecret: f.ClientSecret, + Scopes: scopes, + Endpoint: Endpoint, + } + tok := &oauth2.Token{RefreshToken: f.RefreshToken} + return cfg.TokenSource(ctx, tok), nil + case "": + return nil, errors.New("missing 'type' field in credentials") + default: + return nil, fmt.Errorf("unknown credential type: %q", f.Type) + } } // ComputeTokenSource returns a token source that fetches access tokens diff --git a/components/engine/vendor/golang.org/x/oauth2/google/jwt.go b/components/engine/vendor/golang.org/x/oauth2/google/jwt.go index b91991786f..b0fdb3a888 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/jwt.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/jwt.go @@ -36,6 +36,7 @@ func JWTAccessTokenSourceFromJSON(jsonKey []byte, audience string) (oauth2.Token email: cfg.Email, audience: audience, pk: pk, + pkID: cfg.PrivateKeyID, } tok, err := ts.Token() if err != nil { @@ -47,6 +48,7 @@ func JWTAccessTokenSourceFromJSON(jsonKey []byte, audience string) (oauth2.Token type jwtAccessTokenSource struct { email, audience string pk *rsa.PrivateKey + pkID string } func (ts *jwtAccessTokenSource) Token() (*oauth2.Token, error) { @@ -62,6 +64,7 @@ func (ts *jwtAccessTokenSource) Token() (*oauth2.Token, error) { hdr := &jws.Header{ Algorithm: "RS256", Typ: "JWT", + KeyID: string(ts.pkID), } msg, err := jws.Encode(hdr, cs, ts.pk) if err != nil { diff --git a/components/engine/vendor/golang.org/x/oauth2/google/sdk.go b/components/engine/vendor/golang.org/x/oauth2/google/sdk.go index d29a3bb9bb..bdc18084b1 100644 --- a/components/engine/vendor/golang.org/x/oauth2/google/sdk.go +++ b/components/engine/vendor/golang.org/x/oauth2/google/sdk.go @@ -160,9 +160,13 @@ var sdkConfigPath = func() (string, error) { } func guessUnixHomeDir() string { - usr, err := user.Current() - if err == nil { - return usr.HomeDir + // Prefer $HOME over user.Current due to glibc bug: golang.org/issue/13470 + if v := os.Getenv("HOME"); v != "" { + return v } - return os.Getenv("HOME") + // Else, fall back to user.Current: + if u, err := user.Current(); err == nil { + return u.HomeDir + } + return "" } diff --git a/components/engine/vendor/golang.org/x/oauth2/internal/token.go b/components/engine/vendor/golang.org/x/oauth2/internal/token.go index 39caf6c617..1c0ec76d04 100644 --- a/components/engine/vendor/golang.org/x/oauth2/internal/token.go +++ b/components/engine/vendor/golang.org/x/oauth2/internal/token.go @@ -92,6 +92,7 @@ func (e *expirationTime) UnmarshalJSON(b []byte) error { var brokenAuthHeaderProviders = []string{ "https://accounts.google.com/", "https://api.dropbox.com/", + "https://api.dropboxapi.com/", "https://api.instagram.com/", "https://api.netatmo.net/", "https://api.odnoklassniki.ru/", @@ -105,6 +106,7 @@ var brokenAuthHeaderProviders = []string{ "https://oauth.sandbox.trainingpeaks.com/", "https://oauth.trainingpeaks.com/", "https://oauth.vk.com/", + "https://openapi.baidu.com/", "https://slack.com/", "https://test-sandbox.auth.corp.google.com", "https://test.salesforce.com/", @@ -113,6 +115,10 @@ var brokenAuthHeaderProviders = []string{ "https://www.googleapis.com/", "https://www.linkedin.com/", "https://www.strava.com/oauth/", + "https://www.wunderlist.com/oauth/", + "https://api.patreon.com/", + "https://sandbox.codeswholesale.com/oauth/token", + "https://api.codeswholesale.com/oauth/token", } func RegisterBrokenAuthHeaderProvider(tokenURL string) { @@ -142,23 +148,23 @@ func providerAuthHeaderWorks(tokenURL string) bool { return true } -func RetrieveToken(ctx context.Context, ClientID, ClientSecret, TokenURL string, v url.Values) (*Token, error) { +func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error) { hc, err := ContextClient(ctx) if err != nil { return nil, err } - v.Set("client_id", ClientID) - bustedAuth := !providerAuthHeaderWorks(TokenURL) - if bustedAuth && ClientSecret != "" { - v.Set("client_secret", ClientSecret) + v.Set("client_id", clientID) + bustedAuth := !providerAuthHeaderWorks(tokenURL) + if bustedAuth && clientSecret != "" { + v.Set("client_secret", clientSecret) } - req, err := http.NewRequest("POST", TokenURL, strings.NewReader(v.Encode())) + req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode())) if err != nil { return nil, err } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") if !bustedAuth { - req.SetBasicAuth(ClientID, ClientSecret) + req.SetBasicAuth(clientID, clientSecret) } r, err := hc.Do(req) if err != nil { diff --git a/components/engine/vendor/golang.org/x/oauth2/jws/jws.go b/components/engine/vendor/golang.org/x/oauth2/jws/jws.go index 8ca5978432..683d2d271a 100644 --- a/components/engine/vendor/golang.org/x/oauth2/jws/jws.go +++ b/components/engine/vendor/golang.org/x/oauth2/jws/jws.go @@ -2,8 +2,16 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package jws provides encoding and decoding utilities for -// signed JWS messages. +// Package jws provides a partial implementation +// of JSON Web Signature encoding and decoding. +// It exists to support the golang.org/x/oauth2 package. +// +// See RFC 7515. +// +// Deprecated: this package is not intended for public use and might be +// removed in the future. It exists for internal use only. +// Please switch to another JWS package or copy this package into your own +// source tree. package jws // import "golang.org/x/oauth2/jws" import ( @@ -64,7 +72,7 @@ func (c *ClaimSet) encode() (string, error) { } if len(c.PrivateClaims) == 0 { - return base64Encode(b), nil + return base64.RawURLEncoding.EncodeToString(b), nil } // Marshal private claim set and then append it to b. @@ -82,7 +90,7 @@ func (c *ClaimSet) encode() (string, error) { } b[len(b)-1] = ',' // Replace closing curly brace with a comma. b = append(b, prv[1:]...) // Append private claims. - return base64Encode(b), nil + return base64.RawURLEncoding.EncodeToString(b), nil } // Header represents the header for the signed JWS payloads. @@ -92,6 +100,9 @@ type Header struct { // Represents the token type. Typ string `json:"typ"` + + // The optional hint of which key is being used. + KeyID string `json:"kid,omitempty"` } func (h *Header) encode() (string, error) { @@ -99,7 +110,7 @@ func (h *Header) encode() (string, error) { if err != nil { return "", err } - return base64Encode(b), nil + return base64.RawURLEncoding.EncodeToString(b), nil } // Decode decodes a claim set from a JWS payload. @@ -110,7 +121,7 @@ func Decode(payload string) (*ClaimSet, error) { // TODO(jbd): Provide more context about the error. return nil, errors.New("jws: invalid token received") } - decoded, err := base64Decode(s[1]) + decoded, err := base64.RawURLEncoding.DecodeString(s[1]) if err != nil { return nil, err } @@ -137,7 +148,7 @@ func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error) { if err != nil { return "", err } - return fmt.Sprintf("%s.%s", ss, base64Encode(sig)), nil + return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil } // Encode encodes a signed JWS with provided header and claim set. @@ -145,28 +156,27 @@ func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error) { func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) { sg := func(data []byte) (sig []byte, err error) { h := sha256.New() - h.Write([]byte(data)) + h.Write(data) return rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil)) } return EncodeWithSigner(header, c, sg) } -// base64Encode returns and Base64url encoded version of the input string with any -// trailing "=" stripped. -func base64Encode(b []byte) string { - return strings.TrimRight(base64.URLEncoding.EncodeToString(b), "=") -} - -// base64Decode decodes the Base64url encoded string -func base64Decode(s string) ([]byte, error) { - // add back missing padding - switch len(s) % 4 { - case 1: - s += "===" - case 2: - s += "==" - case 3: - s += "=" +// Verify tests whether the provided JWT token's signature was produced by the private key +// associated with the supplied public key. +func Verify(token string, key *rsa.PublicKey) error { + parts := strings.Split(token, ".") + if len(parts) != 3 { + return errors.New("jws: invalid token received, token must have 3 parts") } - return base64.URLEncoding.DecodeString(s) + + signedContent := parts[0] + "." + parts[1] + signatureString, err := base64.RawURLEncoding.DecodeString(parts[2]) + if err != nil { + return err + } + + h := sha256.New() + h.Write([]byte(signedContent)) + return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), []byte(signatureString)) } diff --git a/components/engine/vendor/golang.org/x/oauth2/jwt/jwt.go b/components/engine/vendor/golang.org/x/oauth2/jwt/jwt.go index 2ffad21a60..f4b9523e6e 100644 --- a/components/engine/vendor/golang.org/x/oauth2/jwt/jwt.go +++ b/components/engine/vendor/golang.org/x/oauth2/jwt/jwt.go @@ -46,6 +46,10 @@ type Config struct { // PrivateKey []byte + // PrivateKeyID contains an optional hint indicating which key is being + // used. + PrivateKeyID string + // Subject is the optional user to impersonate. Subject string diff --git a/components/engine/vendor/golang.org/x/oauth2/oauth2.go b/components/engine/vendor/golang.org/x/oauth2/oauth2.go index a68289607b..7b06bfe1ef 100644 --- a/components/engine/vendor/golang.org/x/oauth2/oauth2.go +++ b/components/engine/vendor/golang.org/x/oauth2/oauth2.go @@ -21,6 +21,8 @@ import ( // NoContext is the default context you should supply if not using // your own context.Context (see https://golang.org/x/net/context). +// +// Deprecated: Use context.Background() or context.TODO() instead. var NoContext = context.TODO() // RegisterBrokenAuthHeaderProvider registers an OAuth2 server @@ -37,6 +39,8 @@ func RegisterBrokenAuthHeaderProvider(tokenURL string) { // Config describes a typical 3-legged OAuth2 flow, with both the // client application information and the server's endpoint URLs. +// For the client credentials 2-legged OAuth2 flow, see the clientcredentials +// package (https://golang.org/x/oauth2/clientcredentials). type Config struct { // ClientID is the application's ID. ClientID string @@ -295,7 +299,7 @@ func NewClient(ctx context.Context, src TokenSource) *http.Client { if src == nil { c, err := internal.ContextClient(ctx) if err != nil { - return &http.Client{Transport: internal.ErrorTransport{err}} + return &http.Client{Transport: internal.ErrorTransport{Err: err}} } return c } diff --git a/components/engine/vendor/google.golang.org/api/gensupport/json.go b/components/engine/vendor/google.golang.org/api/gensupport/json.go deleted file mode 100644 index 193def5938..0000000000 --- a/components/engine/vendor/google.golang.org/api/gensupport/json.go +++ /dev/null @@ -1,177 +0,0 @@ -// 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. - -// Package gensupport is an internal implementation detail used by code -// generated by the google-api-go-generator tool. -// -// This package may be modified at any time without regard for backwards -// compatibility. It should not be used directly by API users. -package gensupport - -import ( - "encoding/json" - "fmt" - "reflect" - "strings" -) - -// MarshalJSON returns a JSON encoding of schema containing only selected fields. -// A field is selected if: -// * it has a non-empty value, or -// * its field name is present in forceSendFields, and -// * it is not a nil pointer or nil interface. -// The JSON key for each selected field is taken from the field's json: struct tag. -func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) { - if len(forceSendFields) == 0 { - return json.Marshal(schema) - } - - mustInclude := make(map[string]struct{}) - for _, f := range forceSendFields { - mustInclude[f] = struct{}{} - } - - dataMap, err := schemaToMap(schema, mustInclude) - if err != nil { - return nil, err - } - return json.Marshal(dataMap) -} - -func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[string]interface{}, error) { - m := make(map[string]interface{}) - s := reflect.ValueOf(schema) - st := s.Type() - - for i := 0; i < s.NumField(); i++ { - jsonTag := st.Field(i).Tag.Get("json") - if jsonTag == "" { - continue - } - tag, err := parseJSONTag(jsonTag) - if err != nil { - return nil, err - } - if tag.ignore { - continue - } - - v := s.Field(i) - f := st.Field(i) - if !includeField(v, f, mustInclude) { - continue - } - - // nil maps are treated as empty maps. - if f.Type.Kind() == reflect.Map && v.IsNil() { - m[tag.apiName] = map[string]string{} - continue - } - - // nil slices are treated as empty slices. - if f.Type.Kind() == reflect.Slice && v.IsNil() { - m[tag.apiName] = []bool{} - continue - } - - if tag.stringFormat { - m[tag.apiName] = formatAsString(v, f.Type.Kind()) - } else { - m[tag.apiName] = v.Interface() - } - } - return m, nil -} - -// formatAsString returns a string representation of v, dereferencing it first if possible. -func formatAsString(v reflect.Value, kind reflect.Kind) string { - if kind == reflect.Ptr && !v.IsNil() { - v = v.Elem() - } - - return fmt.Sprintf("%v", v.Interface()) -} - -// jsonTag represents a restricted version of the struct tag format used by encoding/json. -// It is used to describe the JSON encoding of fields in a Schema struct. -type jsonTag struct { - apiName string - stringFormat bool - ignore bool -} - -// parseJSONTag parses a restricted version of the struct tag format used by encoding/json. -// The format of the tag must match that generated by the Schema.writeSchemaStruct method -// in the api generator. -func parseJSONTag(val string) (jsonTag, error) { - if val == "-" { - return jsonTag{ignore: true}, nil - } - - var tag jsonTag - - i := strings.Index(val, ",") - if i == -1 || val[:i] == "" { - return tag, fmt.Errorf("malformed json tag: %s", val) - } - - tag = jsonTag{ - apiName: val[:i], - } - - switch val[i+1:] { - case "omitempty": - case "omitempty,string": - tag.stringFormat = true - default: - return tag, fmt.Errorf("malformed json tag: %s", val) - } - - return tag, nil -} - -// Reports whether the struct field "f" with value "v" should be included in JSON output. -func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]struct{}) bool { - // The regular JSON encoding of a nil pointer is "null", which means "delete this field". - // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. - // However, many fields are not pointers, so there would be no way to delete these fields. - // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. - // Deletion will be handled by a separate mechanism. - if f.Type.Kind() == reflect.Ptr && v.IsNil() { - return false - } - - // The "any" type is represented as an interface{}. If this interface - // is nil, there is no reasonable representation to send. We ignore - // these fields, for the same reasons as given above for pointers. - if f.Type.Kind() == reflect.Interface && v.IsNil() { - return false - } - - _, ok := mustInclude[f.Name] - return ok || !isEmptyValue(v) -} - -// isEmptyValue reports whether v is the empty value for its type. This -// implementation is based on that of the encoding/json package, but its -// correctness does not depend on it being identical. What's important is that -// this function return false in situations where v should not be sent as part -// of a PATCH operation. -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} diff --git a/components/engine/vendor/google.golang.org/api/gensupport/params.go b/components/engine/vendor/google.golang.org/api/gensupport/params.go deleted file mode 100644 index dfad3f414d..0000000000 --- a/components/engine/vendor/google.golang.org/api/gensupport/params.go +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -package gensupport - -import "net/url" - -// URLParams is a simplified replacement for url.Values -// that safely builds up URL parameters for encoding. -type URLParams map[string][]string - -// Set sets the key to value. -// It replaces any existing values. -func (u URLParams) Set(key, value string) { - u[key] = []string{value} -} - -// SetMulti sets the key to an array of values. -// It replaces any existing values. -// Note that values must not be modified after calling SetMulti -// so the caller is responsible for making a copy if necessary. -func (u URLParams) SetMulti(key string, values []string) { - u[key] = values -} - -// Encode encodes the values into ``URL encoded'' form -// ("bar=baz&foo=quux") sorted by key. -func (u URLParams) Encode() string { - return url.Values(u).Encode() -} diff --git a/components/engine/vendor/google.golang.org/api/googleapi/googleapi.go b/components/engine/vendor/google.golang.org/api/googleapi/googleapi.go deleted file mode 100644 index fbae951023..0000000000 --- a/components/engine/vendor/google.golang.org/api/googleapi/googleapi.go +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package googleapi contains the common code shared by all Google API -// libraries. -package googleapi // import "google.golang.org/api/googleapi" - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/textproto" - "net/url" - "regexp" - "strconv" - "strings" - "sync" - "time" - - "golang.org/x/net/context" - "golang.org/x/net/context/ctxhttp" - "google.golang.org/api/googleapi/internal/uritemplates" -) - -// ContentTyper is an interface for Readers which know (or would like -// to override) their Content-Type. If a media body doesn't implement -// ContentTyper, the type is sniffed from the content using -// http.DetectContentType. -type ContentTyper interface { - ContentType() string -} - -// A SizeReaderAt is a ReaderAt with a Size method. -// An io.SectionReader implements SizeReaderAt. -type SizeReaderAt interface { - io.ReaderAt - Size() int64 -} - -// ServerResponse is embedded in each Do response and -// provides the HTTP status code and header sent by the server. -type ServerResponse struct { - // HTTPStatusCode is the server's response status code. - // When using a resource method's Do call, this will always be in the 2xx range. - HTTPStatusCode int - // Header contains the response header fields from the server. - Header http.Header -} - -const ( - Version = "0.5" - - // statusResumeIncomplete is the code returned by the Google uploader when the transfer is not yet complete. - statusResumeIncomplete = 308 - - // UserAgent is the header string used to identify this package. - UserAgent = "google-api-go-client/" + Version - - // uploadPause determines the delay between failed upload attempts - uploadPause = 1 * time.Second -) - -// Error contains an error response from the server. -type Error struct { - // Code is the HTTP response status code and will always be populated. - Code int `json:"code"` - // Message is the server response message and is only populated when - // explicitly referenced by the JSON server response. - Message string `json:"message"` - // Body is the raw response returned by the server. - // It is often but not always JSON, depending on how the request fails. - Body string - // Header contains the response header fields from the server. - Header http.Header - - Errors []ErrorItem -} - -// ErrorItem is a detailed error code & message from the Google API frontend. -type ErrorItem struct { - // Reason is the typed error code. For example: "some_example". - Reason string `json:"reason"` - // Message is the human-readable description of the error. - Message string `json:"message"` -} - -func (e *Error) Error() string { - if len(e.Errors) == 0 && e.Message == "" { - return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body) - } - var buf bytes.Buffer - fmt.Fprintf(&buf, "googleapi: Error %d: ", e.Code) - if e.Message != "" { - fmt.Fprintf(&buf, "%s", e.Message) - } - if len(e.Errors) == 0 { - return strings.TrimSpace(buf.String()) - } - if len(e.Errors) == 1 && e.Errors[0].Message == e.Message { - fmt.Fprintf(&buf, ", %s", e.Errors[0].Reason) - return buf.String() - } - fmt.Fprintln(&buf, "\nMore details:") - for _, v := range e.Errors { - fmt.Fprintf(&buf, "Reason: %s, Message: %s\n", v.Reason, v.Message) - } - return buf.String() -} - -type errorReply struct { - Error *Error `json:"error"` -} - -// CheckResponse returns an error (of type *Error) if the response -// status code is not 2xx. -func CheckResponse(res *http.Response) error { - if res.StatusCode >= 200 && res.StatusCode <= 299 { - return nil - } - slurp, err := ioutil.ReadAll(res.Body) - if err == nil { - jerr := new(errorReply) - err = json.Unmarshal(slurp, jerr) - if err == nil && jerr.Error != nil { - if jerr.Error.Code == 0 { - jerr.Error.Code = res.StatusCode - } - jerr.Error.Body = string(slurp) - return jerr.Error - } - } - return &Error{ - Code: res.StatusCode, - Body: string(slurp), - Header: res.Header, - } -} - -// IsNotModified reports whether err is the result of the -// server replying with http.StatusNotModified. -// Such error values are sometimes returned by "Do" methods -// on calls when If-None-Match is used. -func IsNotModified(err error) bool { - if err == nil { - return false - } - ae, ok := err.(*Error) - return ok && ae.Code == http.StatusNotModified -} - -// CheckMediaResponse returns an error (of type *Error) if the response -// status code is not 2xx. Unlike CheckResponse it does not assume the -// body is a JSON error document. -func CheckMediaResponse(res *http.Response) error { - if res.StatusCode >= 200 && res.StatusCode <= 299 { - return nil - } - slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20)) - res.Body.Close() - return &Error{ - Code: res.StatusCode, - Body: string(slurp), - } -} - -type MarshalStyle bool - -var WithDataWrapper = MarshalStyle(true) -var WithoutDataWrapper = MarshalStyle(false) - -func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { - buf := new(bytes.Buffer) - if wrap { - buf.Write([]byte(`{"data": `)) - } - err := json.NewEncoder(buf).Encode(v) - if err != nil { - return nil, err - } - if wrap { - buf.Write([]byte(`}`)) - } - return buf, nil -} - -func getMediaType(media io.Reader) (io.Reader, string) { - if typer, ok := media.(ContentTyper); ok { - return media, typer.ContentType() - } - - pr, pw := io.Pipe() - typ := "application/octet-stream" - buf, err := ioutil.ReadAll(io.LimitReader(media, 512)) - if err != nil { - pw.CloseWithError(fmt.Errorf("error reading media: %v", err)) - return pr, typ - } - typ = http.DetectContentType(buf) - mr := io.MultiReader(bytes.NewReader(buf), media) - go func() { - _, err = io.Copy(pw, mr) - if err != nil { - pw.CloseWithError(fmt.Errorf("error reading media: %v", err)) - return - } - pw.Close() - }() - return pr, typ -} - -// DetectMediaType detects and returns the content type of the provided media. -// If the type can not be determined, "application/octet-stream" is returned. -func DetectMediaType(media io.ReaderAt) string { - if typer, ok := media.(ContentTyper); ok { - return typer.ContentType() - } - - typ := "application/octet-stream" - buf := make([]byte, 1024) - n, err := media.ReadAt(buf, 0) - buf = buf[:n] - if err == nil || err == io.EOF { - typ = http.DetectContentType(buf) - } - return typ -} - -type Lengther interface { - Len() int -} - -// endingWithErrorReader from r until it returns an error. If the -// final error from r is io.EOF and e is non-nil, e is used instead. -type endingWithErrorReader struct { - r io.Reader - e error -} - -func (er endingWithErrorReader) Read(p []byte) (n int, err error) { - n, err = er.r.Read(p) - if err == io.EOF && er.e != nil { - err = er.e - } - return -} - -func typeHeader(contentType string) textproto.MIMEHeader { - h := make(textproto.MIMEHeader) - h.Set("Content-Type", contentType) - return h -} - -// countingWriter counts the number of bytes it receives to write, but -// discards them. -type countingWriter struct { - n *int64 -} - -func (w countingWriter) Write(p []byte) (int, error) { - *w.n += int64(len(p)) - return len(p), nil -} - -// ConditionallyIncludeMedia does nothing if media is nil. -// -// bodyp is an in/out parameter. It should initially point to the -// reader of the application/json (or whatever) payload to send in the -// API request. It's updated to point to the multipart body reader. -// -// ctypep is an in/out parameter. It should initially point to the -// content type of the bodyp, usually "application/json". It's updated -// to the "multipart/related" content type, with random boundary. -// -// The return value is the content-length of the entire multpart body. -func ConditionallyIncludeMedia(media io.Reader, bodyp *io.Reader, ctypep *string) (cancel func(), ok bool) { - if media == nil { - return - } - // Get the media type, which might return a different reader instance. - var mediaType string - media, mediaType = getMediaType(media) - - body, bodyType := *bodyp, *ctypep - - pr, pw := io.Pipe() - mpw := multipart.NewWriter(pw) - *bodyp = pr - *ctypep = "multipart/related; boundary=" + mpw.Boundary() - go func() { - w, err := mpw.CreatePart(typeHeader(bodyType)) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: body CreatePart failed: %v", err)) - return - } - _, err = io.Copy(w, body) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: body Copy failed: %v", err)) - return - } - - w, err = mpw.CreatePart(typeHeader(mediaType)) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: media CreatePart failed: %v", err)) - return - } - _, err = io.Copy(w, media) - if err != nil { - mpw.Close() - pw.CloseWithError(fmt.Errorf("googleapi: media Copy failed: %v", err)) - return - } - mpw.Close() - pw.Close() - }() - cancel = func() { pw.CloseWithError(errAborted) } - return cancel, true -} - -var errAborted = errors.New("googleapi: upload aborted") - -// ProgressUpdater is a function that is called upon every progress update of a resumable upload. -// This is the only part of a resumable upload (from googleapi) that is usable by the developer. -// The remaining usable pieces of resumable uploads is exposed in each auto-generated API. -type ProgressUpdater func(current, total int64) - -// ResumableUpload is used by the generated APIs to provide resumable uploads. -// It is not used by developers directly. -type ResumableUpload struct { - Client *http.Client - // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable". - URI string - UserAgent string // User-Agent for header of the request - // Media is the object being uploaded. - Media io.ReaderAt - // MediaType defines the media type, e.g. "image/jpeg". - MediaType string - // ContentLength is the full size of the object being uploaded. - ContentLength int64 - - mu sync.Mutex // guards progress - progress int64 // number of bytes uploaded so far - - // Callback is an optional function that will be called upon every progress update. - Callback ProgressUpdater -} - -var ( - // rangeRE matches the transfer status response from the server. $1 is the last byte index uploaded. - rangeRE = regexp.MustCompile(`^bytes=0\-(\d+)$`) - // chunkSize is the size of the chunks created during a resumable upload and should be a power of two. - // 1<<18 is the minimum size supported by the Google uploader, and there is no maximum. - chunkSize int64 = 1 << 18 -) - -// Progress returns the number of bytes uploaded at this point. -func (rx *ResumableUpload) Progress() int64 { - rx.mu.Lock() - defer rx.mu.Unlock() - return rx.progress -} - -func (rx *ResumableUpload) transferStatus(ctx context.Context) (int64, *http.Response, error) { - req, _ := http.NewRequest("POST", rx.URI, nil) - req.ContentLength = 0 - req.Header.Set("User-Agent", rx.UserAgent) - req.Header.Set("Content-Range", fmt.Sprintf("bytes */%v", rx.ContentLength)) - res, err := ctxhttp.Do(ctx, rx.Client, req) - if err != nil || res.StatusCode != statusResumeIncomplete { - return 0, res, err - } - var start int64 - if m := rangeRE.FindStringSubmatch(res.Header.Get("Range")); len(m) == 2 { - start, err = strconv.ParseInt(m[1], 10, 64) - if err != nil { - return 0, nil, fmt.Errorf("unable to parse range size %v", m[1]) - } - start += 1 // Start at the next byte - } - return start, res, nil -} - -type chunk struct { - body io.Reader - size int64 - err error -} - -func (rx *ResumableUpload) transferChunks(ctx context.Context) (*http.Response, error) { - start, res, err := rx.transferStatus(ctx) - if err != nil || res.StatusCode != statusResumeIncomplete { - if err == context.Canceled { - return &http.Response{StatusCode: http.StatusRequestTimeout}, err - } - return res, err - } - - for { - select { // Check for cancellation - case <-ctx.Done(): - res.StatusCode = http.StatusRequestTimeout - return res, ctx.Err() - default: - } - reqSize := rx.ContentLength - start - if reqSize > chunkSize { - reqSize = chunkSize - } - r := io.NewSectionReader(rx.Media, start, reqSize) - req, _ := http.NewRequest("POST", rx.URI, r) - req.ContentLength = reqSize - req.Header.Set("Content-Range", fmt.Sprintf("bytes %v-%v/%v", start, start+reqSize-1, rx.ContentLength)) - req.Header.Set("Content-Type", rx.MediaType) - req.Header.Set("User-Agent", rx.UserAgent) - res, err = ctxhttp.Do(ctx, rx.Client, req) - start += reqSize - if err == nil && (res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK) { - rx.mu.Lock() - rx.progress = start // keep track of number of bytes sent so far - rx.mu.Unlock() - if rx.Callback != nil { - rx.Callback(start, rx.ContentLength) - } - } - if err != nil || res.StatusCode != statusResumeIncomplete { - break - } - } - return res, err -} - -var sleep = time.Sleep // override in unit tests - -// Upload starts the process of a resumable upload with a cancellable context. -// It retries indefinitely (with a pause of uploadPause between attempts) until cancelled. -// It is called from the auto-generated API code and is not visible to the user. -// rx is private to the auto-generated API code. -func (rx *ResumableUpload) Upload(ctx context.Context) (*http.Response, error) { - var res *http.Response - var err error - for { - res, err = rx.transferChunks(ctx) - if err != nil || res.StatusCode == http.StatusCreated || res.StatusCode == http.StatusOK { - return res, err - } - select { // Check for cancellation - case <-ctx.Done(): - res.StatusCode = http.StatusRequestTimeout - return res, ctx.Err() - default: - } - sleep(uploadPause) - } - return res, err -} - -func ResolveRelative(basestr, relstr string) string { - u, _ := url.Parse(basestr) - rel, _ := url.Parse(relstr) - u = u.ResolveReference(rel) - us := u.String() - us = strings.Replace(us, "%7B", "{", -1) - us = strings.Replace(us, "%7D", "}", -1) - return us -} - -// has4860Fix is whether this Go environment contains the fix for -// http://golang.org/issue/4860 -var has4860Fix bool - -// init initializes has4860Fix by checking the behavior of the net/http package. -func init() { - r := http.Request{ - URL: &url.URL{ - Scheme: "http", - Opaque: "//opaque", - }, - } - b := &bytes.Buffer{} - r.Write(b) - has4860Fix = bytes.HasPrefix(b.Bytes(), []byte("GET http")) -} - -// SetOpaque sets u.Opaque from u.Path such that HTTP requests to it -// don't alter any hex-escaped characters in u.Path. -func SetOpaque(u *url.URL) { - u.Opaque = "//" + u.Host + u.Path - if !has4860Fix { - u.Opaque = u.Scheme + ":" + u.Opaque - } -} - -// Expand subsitutes any {encoded} strings in the URL passed in using -// the map supplied. -// -// This calls SetOpaque to avoid encoding of the parameters in the URL path. -func Expand(u *url.URL, expansions map[string]string) { - expanded, err := uritemplates.Expand(u.Path, expansions) - if err == nil { - u.Path = expanded - SetOpaque(u) - } -} - -// CloseBody is used to close res.Body. -// Prior to calling Close, it also tries to Read a small amount to see an EOF. -// Not seeing an EOF can prevent HTTP Transports from reusing connections. -func CloseBody(res *http.Response) { - if res == nil || res.Body == nil { - return - } - // Justification for 3 byte reads: two for up to "\r\n" after - // a JSON/XML document, and then 1 to see EOF if we haven't yet. - // TODO(bradfitz): detect Go 1.3+ and skip these reads. - // See https://codereview.appspot.com/58240043 - // and https://codereview.appspot.com/49570044 - buf := make([]byte, 1) - for i := 0; i < 3; i++ { - _, err := res.Body.Read(buf) - if err != nil { - break - } - } - res.Body.Close() - -} - -// VariantType returns the type name of the given variant. -// If the map doesn't contain the named key or the value is not a []interface{}, "" is returned. -// This is used to support "variant" APIs that can return one of a number of different types. -func VariantType(t map[string]interface{}) string { - s, _ := t["type"].(string) - return s -} - -// ConvertVariant uses the JSON encoder/decoder to fill in the struct 'dst' with the fields found in variant 'v'. -// This is used to support "variant" APIs that can return one of a number of different types. -// It reports whether the conversion was successful. -func ConvertVariant(v map[string]interface{}, dst interface{}) bool { - var buf bytes.Buffer - err := json.NewEncoder(&buf).Encode(v) - if err != nil { - return false - } - return json.Unmarshal(buf.Bytes(), dst) == nil -} - -// A Field names a field to be retrieved with a partial response. -// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// -// Partial responses can dramatically reduce the amount of data that must be sent to your application. -// In order to request partial responses, you can specify the full list of fields -// that your application needs by adding the Fields option to your request. -// -// Field strings use camelCase with leading lower-case characters to identify fields within the response. -// -// For example, if your response has a "NextPageToken" and a slice of "Items" with "Id" fields, -// you could request just those fields like this: -// -// svc.Events.List().Fields("nextPageToken", "items/id").Do() -// -// or if you were also interested in each Item's "Updated" field, you can combine them like this: -// -// svc.Events.List().Fields("nextPageToken", "items(id,updated)").Do() -// -// More information about field formatting can be found here: -// https://developers.google.com/+/api/#fields-syntax -// -// Another way to find field names is through the Google API explorer: -// https://developers.google.com/apis-explorer/#p/ -type Field string - -// CombineFields combines fields into a single string. -func CombineFields(s []Field) string { - r := make([]string, len(s)) - for i, v := range s { - r[i] = string(v) - } - return strings.Join(r, ",") -} diff --git a/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE deleted file mode 100644 index de9c88cb65..0000000000 --- a/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright (c) 2013 Joshua Tacoma - -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/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go b/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go deleted file mode 100644 index 8a84813fe5..0000000000 --- a/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2013 Joshua Tacoma. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package uritemplates is a level 4 implementation of RFC 6570 (URI -// Template, http://tools.ietf.org/html/rfc6570). -// -// To use uritemplates, parse a template string and expand it with a value -// map: -// -// template, _ := uritemplates.Parse("https://api.github.com/repos{/user,repo}") -// values := make(map[string]interface{}) -// values["user"] = "jtacoma" -// values["repo"] = "uritemplates" -// expanded, _ := template.ExpandString(values) -// fmt.Printf(expanded) -// -package uritemplates - -import ( - "bytes" - "errors" - "fmt" - "reflect" - "regexp" - "strconv" - "strings" -) - -var ( - unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") - reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") - validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") - hex = []byte("0123456789ABCDEF") -) - -func pctEncode(src []byte) []byte { - dst := make([]byte, len(src)*3) - for i, b := range src { - buf := dst[i*3 : i*3+3] - buf[0] = 0x25 - buf[1] = hex[b/16] - buf[2] = hex[b%16] - } - return dst -} - -func escape(s string, allowReserved bool) (escaped string) { - if allowReserved { - escaped = string(reserved.ReplaceAllFunc([]byte(s), pctEncode)) - } else { - escaped = string(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) - } - return escaped -} - -// A UriTemplate is a parsed representation of a URI template. -type UriTemplate struct { - raw string - parts []templatePart -} - -// Parse parses a URI template string into a UriTemplate object. -func Parse(rawtemplate string) (template *UriTemplate, err error) { - template = new(UriTemplate) - template.raw = rawtemplate - split := strings.Split(rawtemplate, "{") - template.parts = make([]templatePart, len(split)*2-1) - for i, s := range split { - if i == 0 { - if strings.Contains(s, "}") { - err = errors.New("unexpected }") - break - } - template.parts[i].raw = s - } else { - subsplit := strings.Split(s, "}") - if len(subsplit) != 2 { - err = errors.New("malformed template") - break - } - expression := subsplit[0] - template.parts[i*2-1], err = parseExpression(expression) - if err != nil { - break - } - template.parts[i*2].raw = subsplit[1] - } - } - if err != nil { - template = nil - } - return template, err -} - -type templatePart struct { - raw string - terms []templateTerm - first string - sep string - named bool - ifemp string - allowReserved bool -} - -type templateTerm struct { - name string - explode bool - truncate int -} - -func parseExpression(expression string) (result templatePart, err error) { - switch expression[0] { - case '+': - result.sep = "," - result.allowReserved = true - expression = expression[1:] - case '.': - result.first = "." - result.sep = "." - expression = expression[1:] - case '/': - result.first = "/" - result.sep = "/" - expression = expression[1:] - case ';': - result.first = ";" - result.sep = ";" - result.named = true - expression = expression[1:] - case '?': - result.first = "?" - result.sep = "&" - result.named = true - result.ifemp = "=" - expression = expression[1:] - case '&': - result.first = "&" - result.sep = "&" - result.named = true - result.ifemp = "=" - expression = expression[1:] - case '#': - result.first = "#" - result.sep = "," - result.allowReserved = true - expression = expression[1:] - default: - result.sep = "," - } - rawterms := strings.Split(expression, ",") - result.terms = make([]templateTerm, len(rawterms)) - for i, raw := range rawterms { - result.terms[i], err = parseTerm(raw) - if err != nil { - break - } - } - return result, err -} - -func parseTerm(term string) (result templateTerm, err error) { - if strings.HasSuffix(term, "*") { - result.explode = true - term = term[:len(term)-1] - } - split := strings.Split(term, ":") - if len(split) == 1 { - result.name = term - } else if len(split) == 2 { - result.name = split[0] - var parsed int64 - parsed, err = strconv.ParseInt(split[1], 10, 0) - result.truncate = int(parsed) - } else { - err = errors.New("multiple colons in same term") - } - if !validname.MatchString(result.name) { - err = errors.New("not a valid name: " + result.name) - } - if result.explode && result.truncate > 0 { - err = errors.New("both explode and prefix modifers on same term") - } - return result, err -} - -// Expand expands a URI template with a set of values to produce a string. -func (self *UriTemplate) Expand(value interface{}) (string, error) { - values, ismap := value.(map[string]interface{}) - if !ismap { - if m, ismap := struct2map(value); !ismap { - return "", errors.New("expected map[string]interface{}, struct, or pointer to struct.") - } else { - return self.Expand(m) - } - } - var buf bytes.Buffer - for _, p := range self.parts { - err := p.expand(&buf, values) - if err != nil { - return "", err - } - } - return buf.String(), nil -} - -func (self *templatePart) expand(buf *bytes.Buffer, values map[string]interface{}) error { - if len(self.raw) > 0 { - buf.WriteString(self.raw) - return nil - } - var zeroLen = buf.Len() - buf.WriteString(self.first) - var firstLen = buf.Len() - for _, term := range self.terms { - value, exists := values[term.name] - if !exists { - continue - } - if buf.Len() != firstLen { - buf.WriteString(self.sep) - } - switch v := value.(type) { - case string: - self.expandString(buf, term, v) - case []interface{}: - self.expandArray(buf, term, v) - case map[string]interface{}: - if term.truncate > 0 { - return errors.New("cannot truncate a map expansion") - } - self.expandMap(buf, term, v) - default: - if m, ismap := struct2map(value); ismap { - if term.truncate > 0 { - return errors.New("cannot truncate a map expansion") - } - self.expandMap(buf, term, m) - } else { - str := fmt.Sprintf("%v", value) - self.expandString(buf, term, str) - } - } - } - if buf.Len() == firstLen { - original := buf.Bytes()[:zeroLen] - buf.Reset() - buf.Write(original) - } - return nil -} - -func (self *templatePart) expandName(buf *bytes.Buffer, name string, empty bool) { - if self.named { - buf.WriteString(name) - if empty { - buf.WriteString(self.ifemp) - } else { - buf.WriteString("=") - } - } -} - -func (self *templatePart) expandString(buf *bytes.Buffer, t templateTerm, s string) { - if len(s) > t.truncate && t.truncate > 0 { - s = s[:t.truncate] - } - self.expandName(buf, t.name, len(s) == 0) - buf.WriteString(escape(s, self.allowReserved)) -} - -func (self *templatePart) expandArray(buf *bytes.Buffer, t templateTerm, a []interface{}) { - if len(a) == 0 { - return - } else if !t.explode { - self.expandName(buf, t.name, false) - } - for i, value := range a { - if t.explode && i > 0 { - buf.WriteString(self.sep) - } else if i > 0 { - buf.WriteString(",") - } - var s string - switch v := value.(type) { - case string: - s = v - default: - s = fmt.Sprintf("%v", v) - } - if len(s) > t.truncate && t.truncate > 0 { - s = s[:t.truncate] - } - if self.named && t.explode { - self.expandName(buf, t.name, len(s) == 0) - } - buf.WriteString(escape(s, self.allowReserved)) - } -} - -func (self *templatePart) expandMap(buf *bytes.Buffer, t templateTerm, m map[string]interface{}) { - if len(m) == 0 { - return - } - if !t.explode { - self.expandName(buf, t.name, len(m) == 0) - } - var firstLen = buf.Len() - for k, value := range m { - if firstLen != buf.Len() { - if t.explode { - buf.WriteString(self.sep) - } else { - buf.WriteString(",") - } - } - var s string - switch v := value.(type) { - case string: - s = v - default: - s = fmt.Sprintf("%v", v) - } - if t.explode { - buf.WriteString(escape(k, self.allowReserved)) - buf.WriteRune('=') - buf.WriteString(escape(s, self.allowReserved)) - } else { - buf.WriteString(escape(k, self.allowReserved)) - buf.WriteRune(',') - buf.WriteString(escape(s, self.allowReserved)) - } - } -} - -func struct2map(v interface{}) (map[string]interface{}, bool) { - value := reflect.ValueOf(v) - switch value.Type().Kind() { - case reflect.Ptr: - return struct2map(value.Elem().Interface()) - case reflect.Struct: - m := make(map[string]interface{}) - for i := 0; i < value.NumField(); i++ { - tag := value.Type().Field(i).Tag - var name string - if strings.Contains(string(tag), ":") { - name = tag.Get("uri") - } else { - name = strings.TrimSpace(string(tag)) - } - if len(name) == 0 { - name = value.Type().Field(i).Name - } - m[name] = value.Field(i).Interface() - } - return m, true - } - return nil, false -} diff --git a/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go b/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go deleted file mode 100644 index 399ef46236..0000000000 --- a/components/engine/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go +++ /dev/null @@ -1,13 +0,0 @@ -package uritemplates - -func Expand(path string, expansions map[string]string) (string, error) { - template, err := Parse(path) - if err != nil { - return "", err - } - values := make(map[string]interface{}) - for k, v := range expansions { - values[k] = v - } - return template.Expand(values) -} diff --git a/components/engine/vendor/google.golang.org/api/googleapi/transport/apikey.go b/components/engine/vendor/google.golang.org/api/googleapi/transport/apikey.go new file mode 100644 index 0000000000..eca1ea2507 --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/googleapi/transport/apikey.go @@ -0,0 +1,38 @@ +// Copyright 2012 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package transport contains HTTP transports used to make +// authenticated API requests. +package transport + +import ( + "errors" + "net/http" +) + +// APIKey is an HTTP Transport which wraps an underlying transport and +// appends an API Key "key" parameter to the URL of outgoing requests. +type APIKey struct { + // Key is the API Key to set on requests. + Key string + + // Transport is the underlying HTTP transport. + // If nil, http.DefaultTransport is used. + Transport http.RoundTripper +} + +func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) { + rt := t.Transport + if rt == nil { + rt = http.DefaultTransport + if rt == nil { + return nil, errors.New("googleapi/transport: no Transport specified or available") + } + } + newReq := *req + args := newReq.URL.Query() + args.Set("key", t.Key) + newReq.URL.RawQuery = args.Encode() + return rt.RoundTrip(&newReq) +} diff --git a/components/engine/vendor/google.golang.org/api/googleapi/types.go b/components/engine/vendor/google.golang.org/api/googleapi/types.go deleted file mode 100644 index a02b4b0716..0000000000 --- a/components/engine/vendor/google.golang.org/api/googleapi/types.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2013 Google Inc. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package googleapi - -import ( - "encoding/json" - "strconv" -) - -// Int64s is a slice of int64s that marshal as quoted strings in JSON. -type Int64s []int64 - -func (q *Int64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseInt(s, 10, 64) - if err != nil { - return err - } - *q = append(*q, int64(v)) - } - return nil -} - -// Int32s is a slice of int32s that marshal as quoted strings in JSON. -type Int32s []int32 - -func (q *Int32s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseInt(s, 10, 32) - if err != nil { - return err - } - *q = append(*q, int32(v)) - } - return nil -} - -// Uint64s is a slice of uint64s that marshal as quoted strings in JSON. -type Uint64s []uint64 - -func (q *Uint64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseUint(s, 10, 64) - if err != nil { - return err - } - *q = append(*q, uint64(v)) - } - return nil -} - -// Uint32s is a slice of uint32s that marshal as quoted strings in JSON. -type Uint32s []uint32 - -func (q *Uint32s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseUint(s, 10, 32) - if err != nil { - return err - } - *q = append(*q, uint32(v)) - } - return nil -} - -// Float64s is a slice of float64s that marshal as quoted strings in JSON. -type Float64s []float64 - -func (q *Float64s) UnmarshalJSON(raw []byte) error { - *q = (*q)[:0] - var ss []string - if err := json.Unmarshal(raw, &ss); err != nil { - return err - } - for _, s := range ss { - v, err := strconv.ParseFloat(s, 64) - if err != nil { - return err - } - *q = append(*q, float64(v)) - } - return nil -} - -func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) { - dst := make([]byte, 0, 2+n*10) // somewhat arbitrary - dst = append(dst, '[') - for i := 0; i < n; i++ { - if i > 0 { - dst = append(dst, ',') - } - dst = append(dst, '"') - dst = fn(dst, i) - dst = append(dst, '"') - } - dst = append(dst, ']') - return dst, nil -} - -func (s Int64s) MarshalJSON() ([]byte, error) { - return quotedList(len(s), func(dst []byte, i int) []byte { - return strconv.AppendInt(dst, s[i], 10) - }) -} - -func (s Int32s) MarshalJSON() ([]byte, error) { - return quotedList(len(s), func(dst []byte, i int) []byte { - return strconv.AppendInt(dst, int64(s[i]), 10) - }) -} - -func (s Uint64s) MarshalJSON() ([]byte, error) { - return quotedList(len(s), func(dst []byte, i int) []byte { - return strconv.AppendUint(dst, s[i], 10) - }) -} - -func (s Uint32s) MarshalJSON() ([]byte, error) { - return quotedList(len(s), func(dst []byte, i int) []byte { - return strconv.AppendUint(dst, uint64(s[i]), 10) - }) -} - -func (s Float64s) MarshalJSON() ([]byte, error) { - return quotedList(len(s), func(dst []byte, i int) []byte { - return strconv.AppendFloat(dst, s[i], 'g', -1, 64) - }) -} - -/* - * Helper routines for simplifying the creation of optional fields of basic type. - */ - -// Bool is a helper routine that allocates a new bool value -// to store v and returns a pointer to it. -func Bool(v bool) *bool { return &v } - -// Int32 is a helper routine that allocates a new int32 value -// to store v and returns a pointer to it. -func Int32(v int32) *int32 { return &v } - -// Int64 is a helper routine that allocates a new int64 value -// to store v and returns a pointer to it. -func Int64(v int64) *int64 { return &v } - -// Float64 is a helper routine that allocates a new float64 value -// to store v and returns a pointer to it. -func Float64(v float64) *float64 { return &v } - -// Uint32 is a helper routine that allocates a new uint32 value -// to store v and returns a pointer to it. -func Uint32(v uint32) *uint32 { return &v } - -// Uint64 is a helper routine that allocates a new uint64 value -// to store v and returns a pointer to it. -func Uint64(v uint64) *uint64 { return &v } - -// String is a helper routine that allocates a new string value -// to store v and returns a pointer to it. -func String(v string) *string { return &v } diff --git a/components/engine/vendor/google.golang.org/api/internal/pool.go b/components/engine/vendor/google.golang.org/api/internal/pool.go new file mode 100644 index 0000000000..4150feb6bb --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/internal/pool.go @@ -0,0 +1,59 @@ +// Copyright 2016 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 internal + +import ( + "errors" + "google.golang.org/grpc/naming" +) + +// PoolResolver provides a fixed list of addresses to load balance between +// and does not provide further updates. +type PoolResolver struct { + poolSize int + dialOpt *DialSettings + ch chan []*naming.Update +} + +// NewPoolResolver returns a PoolResolver +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func NewPoolResolver(size int, o *DialSettings) *PoolResolver { + return &PoolResolver{poolSize: size, dialOpt: o} +} + +// Resolve returns a Watcher for the endpoint defined by the DialSettings +// provided to NewPoolResolver. +func (r *PoolResolver) Resolve(target string) (naming.Watcher, error) { + if r.dialOpt.Endpoint == "" { + return nil, errors.New("No endpoint configured") + } + addrs := make([]*naming.Update, 0, r.poolSize) + for i := 0; i < r.poolSize; i++ { + addrs = append(addrs, &naming.Update{Op: naming.Add, Addr: r.dialOpt.Endpoint, Metadata: i}) + } + r.ch = make(chan []*naming.Update, 1) + r.ch <- addrs + return r, nil +} + +// Next returns a static list of updates on the first call, +// and blocks indefinitely until Close is called on subsequent calls. +func (r *PoolResolver) Next() ([]*naming.Update, error) { + return <-r.ch, nil +} + +func (r *PoolResolver) Close() { + close(r.ch) +} diff --git a/components/engine/vendor/google.golang.org/api/internal/settings.go b/components/engine/vendor/google.golang.org/api/internal/settings.go new file mode 100644 index 0000000000..6e60e48e86 --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/internal/settings.go @@ -0,0 +1,23 @@ +// Package internal supports the options and transport packages. +package internal + +import ( + "net/http" + + "golang.org/x/oauth2" + "google.golang.org/grpc" +) + +// DialSettings holds information needed to establish a connection with a +// Google API service. +type DialSettings struct { + Endpoint string + Scopes []string + ServiceAccountJSONFilename string // if set, TokenSource is ignored. + TokenSource oauth2.TokenSource + UserAgent string + APIKey string + HTTPClient *http.Client + GRPCDialOpts []grpc.DialOption + GRPCConn *grpc.ClientConn +} diff --git a/components/engine/vendor/google.golang.org/api/iterator/iterator.go b/components/engine/vendor/google.golang.org/api/iterator/iterator.go new file mode 100644 index 0000000000..0640c82311 --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/iterator/iterator.go @@ -0,0 +1,231 @@ +// Copyright 2016 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 iterator provides support for standard Google API iterators. +// See https://github.com/GoogleCloudPlatform/gcloud-golang/wiki/Iterator-Guidelines. +package iterator + +import ( + "errors" + "fmt" + "reflect" +) + +// Done is returned by an iterator's Next method when the iteration is +// complete; when there are no more items to return. +var Done = errors.New("no more items in iterator") + +// We don't support mixed calls to Next and NextPage because they play +// with the paging state in incompatible ways. +var errMixed = errors.New("iterator: Next and NextPage called on same iterator") + +// PageInfo contains information about an iterator's paging state. +type PageInfo struct { + // Token is the token used to retrieve the next page of items from the + // API. You may set Token immediately after creating an iterator to + // begin iteration at a particular point. If Token is the empty string, + // the iterator will begin with the first eligible item. + // + // The result of setting Token after the first call to Next is undefined. + // + // After the underlying API method is called to retrieve a page of items, + // Token is set to the next-page token in the response. + Token string + + // MaxSize is the maximum number of items returned by a call to the API. + // Set MaxSize as a hint to optimize the buffering behavior of the iterator. + // If zero, the page size is determined by the underlying service. + // + // Use Pager to retrieve a page of a specific, exact size. + MaxSize int + + // The error state of the iterator. Manipulated by PageInfo.next and Pager. + // This is a latch: it starts as nil, and once set should never change. + err error + + // If true, no more calls to fetch should be made. Set to true when fetch + // returns an empty page token. The iterator is Done when this is true AND + // the buffer is empty. + atEnd bool + + // Function that fetches a page from the underlying service. It should pass + // the pageSize and pageToken arguments to the service, fill the buffer + // with the results from the call, and return the next-page token returned + // by the service. The function must not remove any existing items from the + // buffer. If the underlying RPC takes an int32 page size, pageSize should + // be silently truncated. + fetch func(pageSize int, pageToken string) (nextPageToken string, err error) + + // Function that clears the iterator's buffer, returning any currently buffered items. + bufLen func() int + + // Function that returns the buffer, after setting the buffer variable to nil. + takeBuf func() interface{} + + // Set to true on first call to PageInfo.next or Pager.NextPage. Used to check + // for calls to both Next and NextPage with the same iterator. + nextCalled, nextPageCalled bool +} + +// NewPageInfo exposes internals for iterator implementations. +// It is not a stable interface. +var NewPageInfo = newPageInfo + +// If an iterator can support paging, its iterator-creating method should call +// this (via the NewPageInfo variable above). +// +// The fetch, bufLen and takeBuf arguments provide access to the +// iterator's internal slice of buffered items. They behave as described in +// PageInfo, above. +// +// The return value is the PageInfo.next method bound to the returned PageInfo value. +// (Returning it avoids exporting PageInfo.next.) +func newPageInfo(fetch func(int, string) (string, error), bufLen func() int, takeBuf func() interface{}) (*PageInfo, func() error) { + pi := &PageInfo{ + fetch: fetch, + bufLen: bufLen, + takeBuf: takeBuf, + } + return pi, pi.next +} + +// Remaining returns the number of items available before the iterator makes another API call. +func (pi *PageInfo) Remaining() int { return pi.bufLen() } + +// next provides support for an iterator's Next function. An iterator's Next +// should return the error returned by next if non-nil; else it can assume +// there is at least one item in its buffer, and it should return that item and +// remove it from the buffer. +func (pi *PageInfo) next() error { + pi.nextCalled = true + if pi.err != nil { // Once we get an error, always return it. + // TODO(jba): fix so users can retry on transient errors? Probably not worth it. + return pi.err + } + if pi.nextPageCalled { + pi.err = errMixed + return pi.err + } + // Loop until we get some items or reach the end. + for pi.bufLen() == 0 && !pi.atEnd { + if err := pi.fill(pi.MaxSize); err != nil { + pi.err = err + return pi.err + } + if pi.Token == "" { + pi.atEnd = true + } + } + // Either the buffer is non-empty or pi.atEnd is true (or both). + if pi.bufLen() == 0 { + // The buffer is empty and pi.atEnd is true, i.e. the service has no + // more items. + pi.err = Done + } + return pi.err +} + +// Call the service to fill the buffer, using size and pi.Token. Set pi.Token to the +// next-page token returned by the call. +// If fill returns a non-nil error, the buffer will be empty. +func (pi *PageInfo) fill(size int) error { + tok, err := pi.fetch(size, pi.Token) + if err != nil { + pi.takeBuf() // clear the buffer + return err + } + pi.Token = tok + return nil +} + +// Pageable is implemented by iterators that support paging. +type Pageable interface { + // PageInfo returns paging information associated with the iterator. + PageInfo() *PageInfo +} + +// Pager supports retrieving iterator items a page at a time. +type Pager struct { + pageInfo *PageInfo + pageSize int +} + +// NewPager returns a pager that uses iter. Calls to its NextPage method will +// obtain exactly pageSize items, unless fewer remain. The pageToken argument +// indicates where to start the iteration. Pass the empty string to start at +// the beginning, or pass a token retrieved from a call to Pager.NextPage. +// +// If you use an iterator with a Pager, you must not call Next on the iterator. +func NewPager(iter Pageable, pageSize int, pageToken string) *Pager { + p := &Pager{ + pageInfo: iter.PageInfo(), + pageSize: pageSize, + } + p.pageInfo.Token = pageToken + if pageSize <= 0 { + p.pageInfo.err = errors.New("iterator: page size must be positive") + } + return p +} + +// NextPage retrieves a sequence of items from the iterator and appends them +// to slicep, which must be a pointer to a slice of the iterator's item type. +// Exactly p.pageSize items will be appended, unless fewer remain. +// +// The first return value is the page token to use for the next page of items. +// If empty, there are no more pages. Aside from checking for the end of the +// iteration, the returned page token is only needed if the iteration is to be +// resumed a later time, in another context (possibly another process). +// +// The second return value is non-nil if an error occurred. It will never be +// the special iterator sentinel value Done. To recognize the end of the +// iteration, compare nextPageToken to the empty string. +// +// It is possible for NextPage to return a single zero-length page along with +// an empty page token when there are no more items in the iteration. +func (p *Pager) NextPage(slicep interface{}) (nextPageToken string, err error) { + p.pageInfo.nextPageCalled = true + if p.pageInfo.err != nil { + return "", p.pageInfo.err + } + if p.pageInfo.nextCalled { + p.pageInfo.err = errMixed + return "", p.pageInfo.err + } + if p.pageInfo.bufLen() > 0 { + return "", errors.New("must call NextPage with an empty buffer") + } + // The buffer must be empty here, so takeBuf is a no-op. We call it just to get + // the buffer's type. + wantSliceType := reflect.PtrTo(reflect.ValueOf(p.pageInfo.takeBuf()).Type()) + if slicep == nil { + return "", errors.New("nil passed to Pager.NextPage") + } + vslicep := reflect.ValueOf(slicep) + if vslicep.Type() != wantSliceType { + return "", fmt.Errorf("slicep should be of type %s, got %T", wantSliceType, slicep) + } + for p.pageInfo.bufLen() < p.pageSize { + if err := p.pageInfo.fill(p.pageSize - p.pageInfo.bufLen()); err != nil { + p.pageInfo.err = err + return "", p.pageInfo.err + } + if p.pageInfo.Token == "" { + break + } + } + e := vslicep.Elem() + e.Set(reflect.AppendSlice(e, reflect.ValueOf(p.pageInfo.takeBuf()))) + return p.pageInfo.Token, nil +} diff --git a/components/engine/vendor/google.golang.org/api/logging/v1beta3/logging-gen.go b/components/engine/vendor/google.golang.org/api/logging/v1beta3/logging-gen.go deleted file mode 100644 index 362338c180..0000000000 --- a/components/engine/vendor/google.golang.org/api/logging/v1beta3/logging-gen.go +++ /dev/null @@ -1,4787 +0,0 @@ -// Package logging provides access to the Google Cloud Logging API. -// -// See https://cloud.google.com/logging/docs/ -// -// Usage example: -// -// import "google.golang.org/api/logging/v1beta3" -// ... -// loggingService, err := logging.New(oauthHttpClient) -package logging // import "google.golang.org/api/logging/v1beta3" - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - context "golang.org/x/net/context" - ctxhttp "golang.org/x/net/context/ctxhttp" - gensupport "google.golang.org/api/gensupport" - googleapi "google.golang.org/api/googleapi" - "io" - "net/http" - "net/url" - "strconv" - "strings" -) - -// Always reference these packages, just in case the auto-generated code -// below doesn't. -var _ = bytes.NewBuffer -var _ = strconv.Itoa -var _ = fmt.Sprintf -var _ = json.NewDecoder -var _ = io.Copy -var _ = url.Parse -var _ = gensupport.MarshalJSON -var _ = googleapi.Version -var _ = errors.New -var _ = strings.Replace -var _ = context.Canceled -var _ = ctxhttp.Do - -const apiId = "logging:v1beta3" -const apiName = "logging" -const apiVersion = "v1beta3" -const basePath = "https://logging.googleapis.com/" - -// OAuth2 scopes used by this API. -const ( - // View and manage your data across Google Cloud Platform services - CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" - - // View your data across Google Cloud Platform services - CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only" - - // Administrate log data for your projects - LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin" - - // View log data for your projects - LoggingReadScope = "https://www.googleapis.com/auth/logging.read" - - // Submit log data for your projects - LoggingWriteScope = "https://www.googleapis.com/auth/logging.write" -) - -func New(client *http.Client) (*Service, error) { - if client == nil { - return nil, errors.New("client is nil") - } - s := &Service{client: client, BasePath: basePath} - s.Projects = NewProjectsService(s) - return s, nil -} - -type Service struct { - client *http.Client - BasePath string // API endpoint base URL - UserAgent string // optional additional User-Agent fragment - - Projects *ProjectsService -} - -func (s *Service) userAgent() string { - if s.UserAgent == "" { - return googleapi.UserAgent - } - return googleapi.UserAgent + " " + s.UserAgent -} - -func NewProjectsService(s *Service) *ProjectsService { - rs := &ProjectsService{s: s} - rs.LogServices = NewProjectsLogServicesService(s) - rs.Logs = NewProjectsLogsService(s) - rs.Metrics = NewProjectsMetricsService(s) - rs.Sinks = NewProjectsSinksService(s) - return rs -} - -type ProjectsService struct { - s *Service - - LogServices *ProjectsLogServicesService - - Logs *ProjectsLogsService - - Metrics *ProjectsMetricsService - - Sinks *ProjectsSinksService -} - -func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService { - rs := &ProjectsLogServicesService{s: s} - rs.Indexes = NewProjectsLogServicesIndexesService(s) - rs.Sinks = NewProjectsLogServicesSinksService(s) - return rs -} - -type ProjectsLogServicesService struct { - s *Service - - Indexes *ProjectsLogServicesIndexesService - - Sinks *ProjectsLogServicesSinksService -} - -func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService { - rs := &ProjectsLogServicesIndexesService{s: s} - return rs -} - -type ProjectsLogServicesIndexesService struct { - s *Service -} - -func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService { - rs := &ProjectsLogServicesSinksService{s: s} - return rs -} - -type ProjectsLogServicesSinksService struct { - s *Service -} - -func NewProjectsLogsService(s *Service) *ProjectsLogsService { - rs := &ProjectsLogsService{s: s} - rs.Entries = NewProjectsLogsEntriesService(s) - rs.Sinks = NewProjectsLogsSinksService(s) - return rs -} - -type ProjectsLogsService struct { - s *Service - - Entries *ProjectsLogsEntriesService - - Sinks *ProjectsLogsSinksService -} - -func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService { - rs := &ProjectsLogsEntriesService{s: s} - return rs -} - -type ProjectsLogsEntriesService struct { - s *Service -} - -func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService { - rs := &ProjectsLogsSinksService{s: s} - return rs -} - -type ProjectsLogsSinksService struct { - s *Service -} - -func NewProjectsMetricsService(s *Service) *ProjectsMetricsService { - rs := &ProjectsMetricsService{s: s} - return rs -} - -type ProjectsMetricsService struct { - s *Service -} - -func NewProjectsSinksService(s *Service) *ProjectsSinksService { - rs := &ProjectsSinksService{s: s} - return rs -} - -type ProjectsSinksService struct { - s *Service -} - -// Empty: A generic empty message that you can re-use to avoid defining -// duplicated empty messages in your APIs. A typical example is to use -// it as the request or the response type of an API method. For -// instance: service Foo { rpc Bar(google.protobuf.Empty) returns -// (google.protobuf.Empty); } The JSON representation for `Empty` is -// empty JSON object `{}`. -type Empty struct { - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` -} - -// HttpRequest: A common proto for logging HTTP requests. -type HttpRequest struct { - // CacheHit: Whether or not an entity was served from cache (with or - // without validation). - CacheHit bool `json:"cacheHit,omitempty"` - - // Referer: Referer (a.k.a. referrer) URL of request, as defined in - // http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html. - Referer string `json:"referer,omitempty"` - - // RemoteIp: IP address of the client who issues the HTTP request. Could - // be either IPv4 or IPv6. - RemoteIp string `json:"remoteIp,omitempty"` - - // RequestMethod: Request method, such as `GET`, `HEAD`, `PUT` or - // `POST`. - RequestMethod string `json:"requestMethod,omitempty"` - - // RequestSize: Size of the HTTP request message in bytes, including - // request headers and the request body. - RequestSize int64 `json:"requestSize,omitempty,string"` - - // RequestUrl: Contains the scheme (http|https), the host name, the path - // and the query portion of the URL that was requested. - RequestUrl string `json:"requestUrl,omitempty"` - - // ResponseSize: Size of the HTTP response message in bytes sent back to - // the client, including response headers and response body. - ResponseSize int64 `json:"responseSize,omitempty,string"` - - // Status: A response code indicates the status of response, e.g., 200. - Status int64 `json:"status,omitempty"` - - // UserAgent: User agent sent by the client, e.g., "Mozilla/4.0 - // (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". - UserAgent string `json:"userAgent,omitempty"` - - // ValidatedWithOriginServer: 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. - ValidatedWithOriginServer bool `json:"validatedWithOriginServer,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CacheHit") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *HttpRequest) MarshalJSON() ([]byte, error) { - type noMethod HttpRequest - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogMetricsResponse: Result returned from ListLogMetrics. -type ListLogMetricsResponse struct { - // Metrics: The list of metrics that was requested. - Metrics []*LogMetric `json:"metrics,omitempty"` - - // NextPageToken: If there are more results, then `nextPageToken` is - // returned in the response. To get the next batch of entries, use the - // value of `nextPageToken` as `pageToken` in the next call of - // `ListLogMetrics`. If `nextPageToken` is empty, then there are no more - // results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Metrics") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogMetricsResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogServiceIndexesResponse: Result returned from -// ListLogServiceIndexesRequest. -type ListLogServiceIndexesResponse struct { - // NextPageToken: If there are more results, then `nextPageToken` is - // returned in the response. To get the next batch of indexes, use the - // value of `nextPageToken` as `pageToken` in the next call of - // `ListLogServiceIndexes`. If `nextPageToken` is empty, then there are - // no more results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServiceIndexPrefixes: A list of log service index values. Each index - // value has the form "/value1/value2/...", where `value1` is a value - // in the primary index, `value2` is a value in the secondary index, and - // so forth. - ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "NextPageToken") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogServiceIndexesResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogServiceIndexesResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogServiceSinksResponse: Result returned from -// `ListLogServiceSinks`. -type ListLogServiceSinksResponse struct { - // Sinks: The requested log service sinks. If a returned `LogSink` - // object has an empty `destination` field, the client can retrieve the - // complete `LogSink` object by calling `logServices.sinks.get`. - Sinks []*LogSink `json:"sinks,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Sinks") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogServiceSinksResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogServiceSinksResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogServicesResponse: Result returned from -// `ListLogServicesRequest`. -type ListLogServicesResponse struct { - // LogServices: A list of log services. - LogServices []*LogService `json:"logServices,omitempty"` - - // NextPageToken: If there are more results, then `nextPageToken` is - // returned in the response. To get the next batch of services, use the - // value of `nextPageToken` as `pageToken` in the next call of - // `ListLogServices`. If `nextPageToken` is empty, then there are no - // more results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "LogServices") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogServicesResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogServicesResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogSinksResponse: Result returned from `ListLogSinks`. -type ListLogSinksResponse struct { - // Sinks: The requested log sinks. If a returned `LogSink` object has an - // empty `destination` field, the client can retrieve the complete - // `LogSink` object by calling `log.sinks.get`. - Sinks []*LogSink `json:"sinks,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Sinks") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogSinksResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogSinksResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListLogsResponse: Result returned from ListLogs. -type ListLogsResponse struct { - // Logs: A list of log descriptions matching the criteria. - Logs []*Log `json:"logs,omitempty"` - - // NextPageToken: If there are more results, then `nextPageToken` is - // returned in the response. To get the next batch of logs, use the - // value of `nextPageToken` as `pageToken` in the next call of - // `ListLogs`. If `nextPageToken` is empty, then there are no more - // results. - NextPageToken string `json:"nextPageToken,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Logs") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListLogsResponse) MarshalJSON() ([]byte, error) { - type noMethod ListLogsResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// ListSinksResponse: Result returned from `ListSinks`. -type ListSinksResponse struct { - // Sinks: The requested sinks. If a returned `LogSink` object has an - // empty `destination` field, the client can retrieve the complete - // `LogSink` object by calling `projects.sinks.get`. - Sinks []*LogSink `json:"sinks,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Sinks") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *ListSinksResponse) MarshalJSON() ([]byte, error) { - type noMethod ListSinksResponse - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// Log: _Output only._ Describes a log, which is a named stream of log -// entries. -type Log struct { - // DisplayName: _Optional._ The common name of the log. Example: - // "request_log". - DisplayName string `json:"displayName,omitempty"` - - // Name: The resource name of the log. Example: - // "/projects/my-gcp-project-id/logs/LOG_NAME", where `LOG_NAME` is - // the URL-encoded given name of the log. The log includes those log - // entries whose `LogEntry.log` field contains this given name. To avoid - // name collisions, it is a best practice to prefix the given log name - // with the service name, but this is not required. Examples of log - // given names: "appengine.googleapis.com/request_log", - // "apache-access". - Name string `json:"name,omitempty"` - - // PayloadType: _Optional_. A URI representing the expected payload type - // for log entries. - PayloadType string `json:"payloadType,omitempty"` - - // ForceSendFields is a list of field names (e.g. "DisplayName") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *Log) MarshalJSON() ([]byte, error) { - type noMethod Log - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogEntry: An individual entry in a log. -type LogEntry struct { - // HttpRequest: Information about the HTTP request associated with this - // log entry, if applicable. - HttpRequest *HttpRequest `json:"httpRequest,omitempty"` - - // InsertId: A unique ID for the log entry. If you provide this field, - // the logging service considers other log entries in the same log with - // the same ID as duplicates which can be removed. - InsertId string `json:"insertId,omitempty"` - - // Log: The log to which this entry belongs. When a log entry is - // ingested, the value of this field is set by the logging system. - Log string `json:"log,omitempty"` - - // Metadata: Information about the log entry. - Metadata *LogEntryMetadata `json:"metadata,omitempty"` - - // ProtoPayload: The log entry payload, represented as a protocol buffer - // that is expressed as a JSON object. You can only pass `protoPayload` - // values that belong to a set of approved types. - ProtoPayload LogEntryProtoPayload `json:"protoPayload,omitempty"` - - // StructPayload: The log entry payload, represented as a structure that - // is expressed as a JSON object. - StructPayload LogEntryStructPayload `json:"structPayload,omitempty"` - - // TextPayload: The log entry payload, represented as a Unicode string - // (UTF-8). - TextPayload string `json:"textPayload,omitempty"` - - // ForceSendFields is a list of field names (e.g. "HttpRequest") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogEntry) MarshalJSON() ([]byte, error) { - type noMethod LogEntry - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -type LogEntryProtoPayload interface{} - -type LogEntryStructPayload interface{} - -// LogEntryMetadata: Additional data that is associated with a log -// entry, set by the service creating the log entry. -type LogEntryMetadata struct { - // Labels: A set of (key, value) data that provides additional - // information about the log entry. If the log entry is from one of the - // Google Cloud Platform sources listed below, the indicated (key, - // value) information must be provided: Google App Engine, service_name - // `appengine.googleapis.com`: "appengine.googleapis.com/module_id", - // "appengine.googleapis.com/version_id", and one of: - // "appengine.googleapis.com/replica_index", - // "appengine.googleapis.com/clone_id", or else provide the following - // Compute Engine labels: Google Compute Engine, service_name - // `compute.googleapis.com`: "compute.googleapis.com/resource_type", - // "instance" "compute.googleapis.com/resource_id", - Labels map[string]string `json:"labels,omitempty"` - - // ProjectId: The project ID of the Google Cloud Platform service that - // created the log entry. - ProjectId string `json:"projectId,omitempty"` - - // Region: The region name of the Google Cloud Platform service that - // created the log entry. For example, "us-central1". - Region string `json:"region,omitempty"` - - // ServiceName: The API name of the Google Cloud Platform service that - // created the log entry. For example, "compute.googleapis.com". - ServiceName string `json:"serviceName,omitempty"` - - // Severity: The severity of the log entry. - // - // Possible values: - // "DEFAULT" - // "DEBUG" - // "INFO" - // "NOTICE" - // "WARNING" - // "ERROR" - // "CRITICAL" - // "ALERT" - // "EMERGENCY" - Severity string `json:"severity,omitempty"` - - // Timestamp: The time the event described by the log entry occurred. - // Timestamps must be later than January 1, 1970. - Timestamp string `json:"timestamp,omitempty"` - - // UserId: The fully-qualified email address of the authenticated user - // that performed or requested the action represented by the log entry. - // If the log entry does not apply to an action taken by an - // authenticated user, then the field should be empty. - UserId string `json:"userId,omitempty"` - - // Zone: The zone of the Google Cloud Platform service that created the - // log entry. For example, "us-central1-a". - Zone string `json:"zone,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Labels") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogEntryMetadata) MarshalJSON() ([]byte, error) { - type noMethod LogEntryMetadata - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogError: Describes a problem with a logging resource or operation. -type LogError struct { - // Resource: A resource name associated with this error. For example, - // the name of a Cloud Storage bucket that has insufficient permissions - // to be a destination for log entries. - Resource string `json:"resource,omitempty"` - - // Status: The error description, including a classification code, an - // error message, and other details. - Status *Status `json:"status,omitempty"` - - // TimeNanos: The time the error was observed, in nanoseconds since the - // Unix epoch. - TimeNanos int64 `json:"timeNanos,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "Resource") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogError) MarshalJSON() ([]byte, error) { - type noMethod LogError - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogLine: Application log line emitted while processing a request. -type LogLine struct { - // LogMessage: App provided log message. - LogMessage string `json:"logMessage,omitempty"` - - // Severity: Severity of log. - // - // Possible values: - // "DEFAULT" - // "DEBUG" - // "INFO" - // "NOTICE" - // "WARNING" - // "ERROR" - // "CRITICAL" - // "ALERT" - // "EMERGENCY" - Severity string `json:"severity,omitempty"` - - // SourceLocation: Line of code that generated this log message. - SourceLocation *SourceLocation `json:"sourceLocation,omitempty"` - - // Time: Time when log entry was made. May be inaccurate. - Time string `json:"time,omitempty"` - - // ForceSendFields is a list of field names (e.g. "LogMessage") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogLine) MarshalJSON() ([]byte, error) { - type noMethod LogLine - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogMetric: Describes a logs-based metric. The value of the metric is -// the number of log entries in your project that match a logs filter. -type LogMetric struct { - // Description: A description of this metric. - Description string `json:"description,omitempty"` - - // Filter: An [advanced logs - // filter](/logging/docs/view/advanced_filters). Example: "log:syslog - // AND metadata.severity>=ERROR". - Filter string `json:"filter,omitempty"` - - // Name: The client-assigned name for this metric, such as - // "severe_errors". Metric names are limited to 1000 characters and - // can include only the following characters: `A-Z`, `a-z`, `0-9`, and - // the special characters `_-.,+!*',()%/\`. The slash character (`/`) - // denotes a hierarchy of name pieces, and it cannot be the first - // character of the name. - Name string `json:"name,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Description") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogMetric) MarshalJSON() ([]byte, error) { - type noMethod LogMetric - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogService: _Output only._ Describes a service that writes log -// entries. -type LogService struct { - // IndexKeys: A list of the names of the keys used to index and label - // individual log entries from this service. The first two keys are used - // as the primary and secondary index, respectively. Additional keys may - // be used to label the entries. For example, App Engine indexes its - // entries by module and by version, so its `indexKeys` field is the - // following: [ "appengine.googleapis.com/module_id", - // "appengine.googleapis.com/version_id" ] - IndexKeys []string `json:"indexKeys,omitempty"` - - // Name: The service's name. Example: "appengine.googleapis.com". Log - // names beginning with this string are reserved for this service. This - // value can appear in the `LogEntry.metadata.serviceName` field of log - // entries associated with this log service. - Name string `json:"name,omitempty"` - - // ForceSendFields is a list of field names (e.g. "IndexKeys") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogService) MarshalJSON() ([]byte, error) { - type noMethod LogService - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// LogSink: Describes where log entries are written outside of Cloud -// Logging. -type LogSink struct { - // Destination: The resource name of the destination. Cloud Logging - // writes designated log entries to this destination. For example, - // "storage.googleapis.com/my-output-bucket". - Destination string `json:"destination,omitempty"` - - // Errors: _Output only._ If any errors occur when invoking a sink - // method, then this field contains descriptions of the errors. - Errors []*LogError `json:"errors,omitempty"` - - // Filter: An advanced logs filter. If present, only log entries - // matching the filter are written. Only project sinks use this field; - // log sinks and log service sinks must not include a filter. - Filter string `json:"filter,omitempty"` - - // Name: The client-assigned name of this sink. For example, - // "my-syslog-sink". The name must be unique among the sinks of a - // similar kind in the project. - Name string `json:"name,omitempty"` - - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` - - // ForceSendFields is a list of field names (e.g. "Destination") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *LogSink) MarshalJSON() ([]byte, error) { - type noMethod LogSink - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// RequestLog: Complete log information about a single request to an -// application. -type RequestLog struct { - // AppEngineRelease: App Engine release version string. - AppEngineRelease string `json:"appEngineRelease,omitempty"` - - // AppId: Identifies the application that handled this request. - AppId string `json:"appId,omitempty"` - - // Cost: An indication of the relative cost of serving this request. - Cost float64 `json:"cost,omitempty"` - - // EndTime: Time at which request was known to end processing. - EndTime string `json:"endTime,omitempty"` - - // Finished: If true, represents a finished request. Otherwise, the - // request is active. - Finished bool `json:"finished,omitempty"` - - // Host: The Internet host and port number of the resource being - // requested. - Host string `json:"host,omitempty"` - - // HttpVersion: HTTP version of request. - HttpVersion string `json:"httpVersion,omitempty"` - - // InstanceId: An opaque identifier for the instance that handled the - // request. - InstanceId string `json:"instanceId,omitempty"` - - // InstanceIndex: If the instance that processed this request was - // individually addressable (i.e. belongs to a manually scaled module), - // this is the index of the instance. - InstanceIndex int64 `json:"instanceIndex,omitempty"` - - // Ip: Origin IP address. - Ip string `json:"ip,omitempty"` - - // Latency: Latency of the request. - Latency string `json:"latency,omitempty"` - - // Line: List of log lines emitted by the application while serving this - // request, if requested. - Line []*LogLine `json:"line,omitempty"` - - // MegaCycles: Number of CPU megacycles used to process request. - MegaCycles int64 `json:"megaCycles,omitempty,string"` - - // Method: Request method, such as `GET`, `HEAD`, `PUT`, `POST`, or - // `DELETE`. - Method string `json:"method,omitempty"` - - // ModuleId: Identifies the module of the application that handled this - // request. - ModuleId string `json:"moduleId,omitempty"` - - // Nickname: A string that identifies a logged-in user who made this - // request, or empty if the user is not logged in. 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 may have a similar name. This information is also available to - // the application via Users API. This field will be populated starting - // with App Engine 1.9.21. - Nickname string `json:"nickname,omitempty"` - - // PendingTime: Time this request spent in the pending request queue, if - // it was pending at all. - PendingTime string `json:"pendingTime,omitempty"` - - // Referrer: Referrer URL of request. - Referrer string `json:"referrer,omitempty"` - - // RequestId: Globally unique identifier for a request, based on request - // start time. Request IDs for requests which started later will compare - // greater as strings than those for requests which started earlier. - RequestId string `json:"requestId,omitempty"` - - // Resource: 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". Any trailing fragment (separated by a '#' character) - // will not be included. - Resource string `json:"resource,omitempty"` - - // ResponseSize: Size in bytes sent back to client by request. - ResponseSize int64 `json:"responseSize,omitempty,string"` - - // SourceReference: 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 `json:"sourceReference,omitempty"` - - // StartTime: Time at which request was known to have begun processing. - StartTime string `json:"startTime,omitempty"` - - // Status: Response status of request. - Status int64 `json:"status,omitempty"` - - // TaskName: Task name of the request (for an offline request). - TaskName string `json:"taskName,omitempty"` - - // TaskQueueName: Queue name of the request (for an offline request). - TaskQueueName string `json:"taskQueueName,omitempty"` - - // TraceId: Cloud Trace identifier of the trace for this request. - TraceId string `json:"traceId,omitempty"` - - // UrlMapEntry: File or class within URL mapping used for request. - // Useful for tracking down the source code which was responsible for - // managing request. Especially for multiply mapped handlers. - UrlMapEntry string `json:"urlMapEntry,omitempty"` - - // UserAgent: User agent used for making request. - UserAgent string `json:"userAgent,omitempty"` - - // VersionId: Version of the application that handled this request. - VersionId string `json:"versionId,omitempty"` - - // WasLoadingRequest: Was this request a loading request for this - // instance? - WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"` - - // ForceSendFields is a list of field names (e.g. "AppEngineRelease") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *RequestLog) MarshalJSON() ([]byte, error) { - type noMethod RequestLog - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// SourceLocation: Specifies a location in a source file. -type SourceLocation struct { - // File: Source file name. May or may not be a fully qualified name, - // depending on the runtime environment. - File string `json:"file,omitempty"` - - // FunctionName: Human-readable name of the function or method being - // invoked, with optional context such as the class or package name, for - // use in contexts such as the logs viewer where file:line number is - // less meaningful. This may vary by language, for example: in Java: - // qual.if.ied.Class.method in Go: dir/package.func in Python: function - // ... - FunctionName string `json:"functionName,omitempty"` - - // Line: Line within the source file. - Line int64 `json:"line,omitempty,string"` - - // ForceSendFields is a list of field names (e.g. "File") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SourceLocation) MarshalJSON() ([]byte, error) { - type noMethod SourceLocation - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// SourceReference: A reference to a particular snapshot of the source -// tree used to build and deploy an application. -type SourceReference struct { - // Repository: Optional. A URI string identifying the repository. - // Example: "https://github.com/GoogleCloudPlatform/kubernetes.git" - Repository string `json:"repository,omitempty"` - - // RevisionId: The canonical (and persistent) identifier of the deployed - // revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" - RevisionId string `json:"revisionId,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Repository") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *SourceReference) MarshalJSON() ([]byte, error) { - type noMethod SourceReference - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// Status: 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, 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` -// which 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 purpose. - 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 { - // Code: The status code, which should be an enum value of - // google.rpc.Code. - Code int64 `json:"code,omitempty"` - - // Details: A list of messages that carry the error details. There will - // be a common set of message types for APIs to use. - Details []StatusDetails `json:"details,omitempty"` - - // Message: 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 field, or localized by the client. - Message string `json:"message,omitempty"` - - // ForceSendFields is a list of field names (e.g. "Code") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *Status) MarshalJSON() ([]byte, error) { - type noMethod Status - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -type StatusDetails interface{} - -// WriteLogEntriesRequest: The parameters to WriteLogEntries. -type WriteLogEntriesRequest struct { - // CommonLabels: Metadata labels that apply to all log entries in this - // request, so that you don't have to repeat them in each log entry's - // `metadata.labels` field. If any of the log entries contains a (key, - // value) with the same key that is in `commonLabels`, then the entry's - // (key, value) overrides the one in `commonLabels`. - CommonLabels map[string]string `json:"commonLabels,omitempty"` - - // Entries: Log entries to insert. - Entries []*LogEntry `json:"entries,omitempty"` - - // ForceSendFields is a list of field names (e.g. "CommonLabels") to - // unconditionally include in API requests. By default, fields with - // empty values are omitted from API requests. However, any non-pointer, - // non-interface field appearing in ForceSendFields will be sent to the - // server regardless of whether the field is empty or not. This may be - // used to include empty fields in Patch requests. - ForceSendFields []string `json:"-"` -} - -func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) { - type noMethod WriteLogEntriesRequest - raw := noMethod(*s) - return gensupport.MarshalJSON(raw, s.ForceSendFields) -} - -// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty -type WriteLogEntriesResponse struct { - // ServerResponse contains the HTTP response code and headers from the - // server. - googleapi.ServerResponse `json:"-"` -} - -// method id "logging.projects.logServices.list": - -type ProjectsLogServicesListCall struct { - s *Service - projectsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists the log services that have log entries in this project. -func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall { - c := &ProjectsLogServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of `LogService` objects to return in one operation. -func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": An opaque token, -// returned as `nextPageToken` by a prior `ListLogServices` operation. -// If `pageToken` is supplied, then the other fields of this request are -// ignored, and instead the previous `ListLogServices` operation is -// continued. -func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesListCall) QuotaUser(quotaUser string) *ProjectsLogServicesListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogServicesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesListCall) Context(ctx context.Context) *ProjectsLogServicesListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.list" call. -// Exactly one of *ListLogServicesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogServicesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogServicesListCall) Do() (*ListLogServicesResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogServicesResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists the log services that have log entries in this project.", - // "httpMethod": "GET", - // "id": "logging.projects.logServices.list", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "pageSize": { - // "description": "The maximum number of `LogService` objects to return in one operation.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.", - // "location": "query", - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `projectName`. The resource name of the project whose services are to be listed.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices", - // "response": { - // "$ref": "ListLogServicesResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logServices.indexes.list": - -type ProjectsLogServicesIndexesListCall struct { - s *Service - projectsId string - logServicesId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists the current index values for a log service. -func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall { - c := &ProjectsLogServicesIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - return c -} - -// Depth sets the optional parameter "depth": A non-negative integer -// that limits the number of levels of the index hierarchy that are -// returned. If `depth` is 1 (default), only the first index key value -// is returned. If `depth` is 2, both primary and secondary key values -// are returned. If `depth` is 0, the depth is the number of -// slash-separators in the `indexPrefix` field, not counting a slash -// appearing as the last character of the prefix. If the `indexPrefix` -// field is empty, the default depth is 1. It is an error for `depth` to -// be any positive value less than the number of components in -// `indexPrefix`. -func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("depth", fmt.Sprint(depth)) - return c -} - -// IndexPrefix sets the optional parameter "indexPrefix": Restricts the -// index values returned to be those with a specified prefix for each -// index key. This field has the form "/prefix1/prefix2/...", in order -// corresponding to the `LogService indexKeys`. Non-empty prefixes must -// begin with `/`. For example, App Engine's two keys are the module ID -// and the version ID. Following is the effect of using various values -// for `indexPrefix`: + "/Mod/" retrieves `/Mod/10` and `/Mod/11` but -// not `/ModA/10`. + "/Mod` retrieves `/Mod/10`, `/Mod/11` and -// `/ModA/10` but not `/XXX/33`. + "/Mod/1" retrieves `/Mod/10` and -// `/Mod/11` but not `/ModA/10`. + "/Mod/10/" retrieves `/Mod/10` -// only. + An empty prefix or "/" retrieves all values. -func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("indexPrefix", indexPrefix) - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of log service index resources to return in one operation. -func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": An opaque token, -// returned as `nextPageToken` by a prior `ListLogServiceIndexes` -// operation. If `pageToken` is supplied, then the other fields of this -// request are ignored, and instead the previous `ListLogServiceIndexes` -// operation is continued. -func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesIndexesListCall) QuotaUser(quotaUser string) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogServicesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesIndexesListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesIndexesListCall) Context(ctx context.Context) *ProjectsLogServicesIndexesListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesIndexesListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.indexes.list" call. -// Exactly one of *ListLogServiceIndexesResponse or error will be -// non-nil. Any non-2xx status code is an error. Response headers are in -// either *ListLogServiceIndexesResponse.ServerResponse.Header or (if a -// response was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogServicesIndexesListCall) Do() (*ListLogServiceIndexesResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogServiceIndexesResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists the current index values for a log service.", - // "httpMethod": "GET", - // "id": "logging.projects.logServices.indexes.list", - // "parameterOrder": [ - // "projectsId", - // "logServicesId" - // ], - // "parameters": { - // "depth": { - // "description": "A non-negative integer that limits the number of levels of the index hierarchy that are returned. If `depth` is 1 (default), only the first index key value is returned. If `depth` is 2, both primary and secondary key values are returned. If `depth` is 0, the depth is the number of slash-separators in the `indexPrefix` field, not counting a slash appearing as the last character of the prefix. If the `indexPrefix` field is empty, the default depth is 1. It is an error for `depth` to be any positive value less than the number of components in `indexPrefix`.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "indexPrefix": { - // "description": "Restricts the index values returned to be those with a specified prefix for each index key. This field has the form `\"/prefix1/prefix2/...\"`, in order corresponding to the `LogService indexKeys`. Non-empty prefixes must begin with `/`. For example, App Engine's two keys are the module ID and the version ID. Following is the effect of using various values for `indexPrefix`: + `\"/Mod/\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod` retrieves `/Mod/10`, `/Mod/11` and `/ModA/10` but not `/XXX/33`. + `\"/Mod/1\"` retrieves `/Mod/10` and `/Mod/11` but not `/ModA/10`. + `\"/Mod/10/\"` retrieves `/Mod/10` only. + An empty prefix or `\"/\"` retrieves all values.", - // "location": "query", - // "type": "string" - // }, - // "logServicesId": { - // "description": "Part of `serviceName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "pageSize": { - // "description": "The maximum number of log service index resources to return in one operation.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.", - // "location": "query", - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `serviceName`. The resource name of a log service whose service indexes are requested. Example: `\"projects/my-project-id/logServices/appengine.googleapis.com\"`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes", - // "response": { - // "$ref": "ListLogServiceIndexesResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logServices.sinks.create": - -type ProjectsLogServicesSinksCreateCall struct { - s *Service - projectsId string - logServicesId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Create: Creates a log service sink. All log entries from a specified -// log service are written to the destination. -func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall { - c := &ProjectsLogServicesSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesSinksCreateCall) QuotaUser(quotaUser string) *ProjectsLogServicesSinksCreateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesSinksCreateCall) Context(ctx context.Context) *ProjectsLogServicesSinksCreateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesSinksCreateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogServicesSinksCreateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a log service sink. All log entries from a specified log service are written to the destination.", - // "httpMethod": "POST", - // "id": "logging.projects.logServices.sinks.create", - // "parameterOrder": [ - // "projectsId", - // "logServicesId" - // ], - // "parameters": { - // "logServicesId": { - // "description": "Part of `serviceName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `serviceName`. The resource name of the log service to which the sink is bound.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logServices.sinks.delete": - -type ProjectsLogServicesSinksDeleteCall struct { - s *Service - projectsId string - logServicesId string - sinksId string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes a log service sink. After deletion, no new log -// entries are written to the destination. -func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall { - c := &ProjectsLogServicesSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesSinksDeleteCall) QuotaUser(quotaUser string) *ProjectsLogServicesSinksDeleteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesSinksDeleteCall) Context(ctx context.Context) *ProjectsLogServicesSinksDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesSinksDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogServicesSinksDeleteCall) Do() (*Empty, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a log service sink. After deletion, no new log entries are written to the destination.", - // "httpMethod": "DELETE", - // "id": "logging.projects.logServices.sinks.delete", - // "parameterOrder": [ - // "projectsId", - // "logServicesId", - // "sinksId" - // ], - // "parameters": { - // "logServicesId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the log service sink to delete.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logServices.sinks.get": - -type ProjectsLogServicesSinksGetCall struct { - s *Service - projectsId string - logServicesId string - sinksId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// Get: Gets a log service sink. -func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall { - c := &ProjectsLogServicesSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesSinksGetCall) QuotaUser(quotaUser string) *ProjectsLogServicesSinksGetCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogServicesSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesSinksGetCall) Context(ctx context.Context) *ProjectsLogServicesSinksGetCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesSinksGetCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogServicesSinksGetCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Gets a log service sink.", - // "httpMethod": "GET", - // "id": "logging.projects.logServices.sinks.get", - // "parameterOrder": [ - // "projectsId", - // "logServicesId", - // "sinksId" - // ], - // "parameters": { - // "logServicesId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the log service sink to return.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logServices.sinks.list": - -type ProjectsLogServicesSinksListCall struct { - s *Service - projectsId string - logServicesId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists log service sinks associated with a log service. -func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall { - c := &ProjectsLogServicesSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesSinksListCall) QuotaUser(quotaUser string) *ProjectsLogServicesSinksListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogServicesSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesSinksListCall) Context(ctx context.Context) *ProjectsLogServicesSinksListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesSinksListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.sinks.list" call. -// Exactly one of *ListLogServiceSinksResponse or error will be non-nil. -// Any non-2xx status code is an error. Response headers are in either -// *ListLogServiceSinksResponse.ServerResponse.Header or (if a response -// was returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogServicesSinksListCall) Do() (*ListLogServiceSinksResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogServiceSinksResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists log service sinks associated with a log service.", - // "httpMethod": "GET", - // "id": "logging.projects.logServices.sinks.list", - // "parameterOrder": [ - // "projectsId", - // "logServicesId" - // ], - // "parameters": { - // "logServicesId": { - // "description": "Part of `serviceName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `serviceName`. The log service whose sinks are wanted.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks", - // "response": { - // "$ref": "ListLogServiceSinksResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logServices.sinks.update": - -type ProjectsLogServicesSinksUpdateCall struct { - s *Service - projectsId string - logServicesId string - sinksId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Update: Updates a log service sink. If the sink does not exist, it is -// created. -func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall { - c := &ProjectsLogServicesSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logServicesId = logServicesId - c.sinksId = sinksId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogServicesSinksUpdateCall) QuotaUser(quotaUser string) *ProjectsLogServicesSinksUpdateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogServicesSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogServicesSinksUpdateCall) Context(ctx context.Context) *ProjectsLogServicesSinksUpdateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogServicesSinksUpdateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("PUT", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logServicesId": c.logServicesId, - "sinksId": c.sinksId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logServices.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogServicesSinksUpdateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a log service sink. If the sink does not exist, it is created.", - // "httpMethod": "PUT", - // "id": "logging.projects.logServices.sinks.update", - // "parameterOrder": [ - // "projectsId", - // "logServicesId", - // "sinksId" - // ], - // "parameters": { - // "logServicesId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the log service sink to update.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logs.delete": - -type ProjectsLogsDeleteCall struct { - s *Service - projectsId string - logsId string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes a log and all its log entries. The log will reappear -// if it receives new entries. -func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall { - c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsDeleteCall) QuotaUser(quotaUser string) *ProjectsLogsDeleteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogsDeleteCall) Do() (*Empty, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a log and all its log entries. The log will reappear if it receives new entries.", - // "httpMethod": "DELETE", - // "id": "logging.projects.logs.delete", - // "parameterOrder": [ - // "projectsId", - // "logsId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `logName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `logName`. The resource name of the log to be deleted.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logs.list": - -type ProjectsLogsListCall struct { - s *Service - projectsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists the logs in the project. Only logs that have entries are -// listed. -func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall { - c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of results to return. -func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": An opaque token, -// returned as `nextPageToken` by a prior `ListLogs` operation. If -// `pageToken` is supplied, then the other fields of this request are -// ignored, and instead the previous `ListLogs` operation is continued. -func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsListCall) QuotaUser(quotaUser string) *ProjectsLogsListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix": -// The purpose of this field is to restrict the listed logs to those -// with entries of a certain kind. If `serviceName` is the name of a log -// service, then this field may contain values for the log service's -// indexes. Only logs that have entries whose indexes include the values -// are listed. The format for this field is "/val1/val2.../valN", -// where `val1` is a value for the first index, `val2` for the second -// index, etc. An empty value (a single slash) for an index matches all -// values, and you can omit values for later indexes entirely. -func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall { - c.urlParams_.Set("serviceIndexPrefix", serviceIndexPrefix) - return c -} - -// ServiceName sets the optional parameter "serviceName": If not empty, -// this field must be a log service name such as -// "compute.googleapis.com". Only logs associated with that that log -// service are listed. -func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall { - c.urlParams_.Set("serviceName", serviceName) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.list" call. -// Exactly one of *ListLogsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogsListCall) Do() (*ListLogsResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists the logs in the project. Only logs that have entries are listed.", - // "httpMethod": "GET", - // "id": "logging.projects.logs.list", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "pageSize": { - // "description": "The maximum number of results to return.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.", - // "location": "query", - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `projectName`. The resource name of the project whose logs are requested. If both `serviceName` and `serviceIndexPrefix` are empty, then all logs with entries in this project are listed.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "serviceIndexPrefix": { - // "description": "The purpose of this field is to restrict the listed logs to those with entries of a certain kind. If `serviceName` is the name of a log service, then this field may contain values for the log service's indexes. Only logs that have entries whose indexes include the values are listed. The format for this field is `\"/val1/val2.../valN\"`, where `val1` is a value for the first index, `val2` for the second index, etc. An empty value (a single slash) for an index matches all values, and you can omit values for later indexes entirely.", - // "location": "query", - // "type": "string" - // }, - // "serviceName": { - // "description": "If not empty, this field must be a log service name such as `\"compute.googleapis.com\"`. Only logs associated with that that log service are listed.", - // "location": "query", - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs", - // "response": { - // "$ref": "ListLogsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logs.entries.write": - -type ProjectsLogsEntriesWriteCall struct { - s *Service - projectsId string - logsId string - writelogentriesrequest *WriteLogEntriesRequest - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Write: Writes log entries to Cloud Logging. Each entry consists of a -// `LogEntry` object. You must fill in all the fields of the object, -// including one of the payload fields. You may supply a map, -// `commonLabels`, that holds default (key, value) data for the -// `entries[].metadata.labels` map in each entry, saving you the trouble -// of creating identical copies for each entry. -func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall { - c := &ProjectsLogsEntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - c.writelogentriesrequest = writelogentriesrequest - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsEntriesWriteCall) QuotaUser(quotaUser string) *ProjectsLogsEntriesWriteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsEntriesWriteCall) Fields(s ...googleapi.Field) *ProjectsLogsEntriesWriteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsEntriesWriteCall) Context(ctx context.Context) *ProjectsLogsEntriesWriteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsEntriesWriteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.entries.write" call. -// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogsEntriesWriteCall) Do() (*WriteLogEntriesResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &WriteLogEntriesResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Writes log entries to Cloud Logging. Each entry consists of a `LogEntry` object. You must fill in all the fields of the object, including one of the payload fields. You may supply a map, `commonLabels`, that holds default (key, value) data for the `entries[].metadata.labels` map in each entry, saving you the trouble of creating identical copies for each entry.", - // "httpMethod": "POST", - // "id": "logging.projects.logs.entries.write", - // "parameterOrder": [ - // "projectsId", - // "logsId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `logName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `logName`. The resource name of the log that will receive the log entries.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write", - // "request": { - // "$ref": "WriteLogEntriesRequest" - // }, - // "response": { - // "$ref": "WriteLogEntriesResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" - // ] - // } - -} - -// method id "logging.projects.logs.sinks.create": - -type ProjectsLogsSinksCreateCall struct { - s *Service - projectsId string - logsId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Create: Creates a log sink. All log entries for a specified log are -// written to the destination. -func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall { - c := &ProjectsLogsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsSinksCreateCall) QuotaUser(quotaUser string) *ProjectsLogsSinksCreateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsSinksCreateCall) Context(ctx context.Context) *ProjectsLogsSinksCreateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsSinksCreateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogsSinksCreateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a log sink. All log entries for a specified log are written to the destination.", - // "httpMethod": "POST", - // "id": "logging.projects.logs.sinks.create", - // "parameterOrder": [ - // "projectsId", - // "logsId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `logName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `logName`. The resource name of the log to which to the sink is bound.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logs.sinks.delete": - -type ProjectsLogsSinksDeleteCall struct { - s *Service - projectsId string - logsId string - sinksId string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes a log sink. After deletion, no new log entries are -// written to the destination. -func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall { - c := &ProjectsLogsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsSinksDeleteCall) QuotaUser(quotaUser string) *ProjectsLogsSinksDeleteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsSinksDeleteCall) Context(ctx context.Context) *ProjectsLogsSinksDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogsSinksDeleteCall) Do() (*Empty, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a log sink. After deletion, no new log entries are written to the destination.", - // "httpMethod": "DELETE", - // "id": "logging.projects.logs.sinks.delete", - // "parameterOrder": [ - // "projectsId", - // "logsId", - // "sinksId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the log sink to delete.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.logs.sinks.get": - -type ProjectsLogsSinksGetCall struct { - s *Service - projectsId string - logsId string - sinksId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// Get: Gets a log sink. -func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall { - c := &ProjectsLogsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsSinksGetCall) QuotaUser(quotaUser string) *ProjectsLogsSinksGetCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsSinksGetCall) Context(ctx context.Context) *ProjectsLogsSinksGetCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsSinksGetCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogsSinksGetCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Gets a log sink.", - // "httpMethod": "GET", - // "id": "logging.projects.logs.sinks.get", - // "parameterOrder": [ - // "projectsId", - // "logsId", - // "sinksId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the log sink to return.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logs.sinks.list": - -type ProjectsLogsSinksListCall struct { - s *Service - projectsId string - logsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists log sinks associated with a log. -func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall { - c := &ProjectsLogsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsSinksListCall) QuotaUser(quotaUser string) *ProjectsLogsSinksListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsLogsSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsSinksListCall) Context(ctx context.Context) *ProjectsLogsSinksListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsSinksListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.sinks.list" call. -// Exactly one of *ListLogSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogSinksResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsLogsSinksListCall) Do() (*ListLogSinksResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogSinksResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists log sinks associated with a log.", - // "httpMethod": "GET", - // "id": "logging.projects.logs.sinks.list", - // "parameterOrder": [ - // "projectsId", - // "logsId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `logName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `logName`. The log whose sinks are wanted. For example, `\"compute.google.com/syslog\"`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks", - // "response": { - // "$ref": "ListLogSinksResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.logs.sinks.update": - -type ProjectsLogsSinksUpdateCall struct { - s *Service - projectsId string - logsId string - sinksId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Update: Updates a log sink. If the sink does not exist, it is -// created. -func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall { - c := &ProjectsLogsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsId = logsId - c.sinksId = sinksId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsLogsSinksUpdateCall) QuotaUser(quotaUser string) *ProjectsLogsSinksUpdateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsLogsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsLogsSinksUpdateCall) Context(ctx context.Context) *ProjectsLogsSinksUpdateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsLogsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("PUT", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "logsId": c.logsId, - "sinksId": c.sinksId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.logs.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsLogsSinksUpdateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a log sink. If the sink does not exist, it is created.", - // "httpMethod": "PUT", - // "id": "logging.projects.logs.sinks.update", - // "parameterOrder": [ - // "projectsId", - // "logsId", - // "sinksId" - // ], - // "parameters": { - // "logsId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the sink to update.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.metrics.create": - -type ProjectsMetricsCreateCall struct { - s *Service - projectsId string - logmetric *LogMetric - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Create: Creates a logs-based metric. -func (r *ProjectsMetricsService) Create(projectsId string, logmetric *LogMetric) *ProjectsMetricsCreateCall { - c := &ProjectsMetricsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logmetric = logmetric - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsMetricsCreateCall) QuotaUser(quotaUser string) *ProjectsMetricsCreateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.metrics.create" call. -// Exactly one of *LogMetric or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogMetric.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsMetricsCreateCall) Do() (*LogMetric, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogMetric{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a logs-based metric.", - // "httpMethod": "POST", - // "id": "logging.projects.metrics.create", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `projectName`. The resource name of the project in which to create the metric.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/metrics", - // "request": { - // "$ref": "LogMetric" - // }, - // "response": { - // "$ref": "LogMetric" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" - // ] - // } - -} - -// method id "logging.projects.metrics.delete": - -type ProjectsMetricsDeleteCall struct { - s *Service - projectsId string - metricsId string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes a logs-based metric. -func (r *ProjectsMetricsService) Delete(projectsId string, metricsId string) *ProjectsMetricsDeleteCall { - c := &ProjectsMetricsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.metricsId = metricsId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsMetricsDeleteCall) QuotaUser(quotaUser string) *ProjectsMetricsDeleteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "metricsId": c.metricsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.metrics.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsMetricsDeleteCall) Do() (*Empty, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a logs-based metric.", - // "httpMethod": "DELETE", - // "id": "logging.projects.metrics.delete", - // "parameterOrder": [ - // "projectsId", - // "metricsId" - // ], - // "parameters": { - // "metricsId": { - // "description": "Part of `metricName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `metricName`. The resource name of the metric to delete.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" - // ] - // } - -} - -// method id "logging.projects.metrics.get": - -type ProjectsMetricsGetCall struct { - s *Service - projectsId string - metricsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// Get: Gets a logs-based metric. -func (r *ProjectsMetricsService) Get(projectsId string, metricsId string) *ProjectsMetricsGetCall { - c := &ProjectsMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.metricsId = metricsId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsMetricsGetCall) QuotaUser(quotaUser string) *ProjectsMetricsGetCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "metricsId": c.metricsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.metrics.get" call. -// Exactly one of *LogMetric or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogMetric.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsMetricsGetCall) Do() (*LogMetric, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogMetric{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Gets a logs-based metric.", - // "httpMethod": "GET", - // "id": "logging.projects.metrics.get", - // "parameterOrder": [ - // "projectsId", - // "metricsId" - // ], - // "parameters": { - // "metricsId": { - // "description": "Part of `metricName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `metricName`. The resource name of the desired metric.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", - // "response": { - // "$ref": "LogMetric" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.metrics.list": - -type ProjectsMetricsListCall struct { - s *Service - projectsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists the logs-based metrics associated with a project. -func (r *ProjectsMetricsService) List(projectsId string) *ProjectsMetricsListCall { - c := &ProjectsMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - return c -} - -// PageSize sets the optional parameter "pageSize": The maximum number -// of `LogMetric` objects to return in one operation. -func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall { - c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) - return c -} - -// PageToken sets the optional parameter "pageToken": An opaque token, -// returned as `nextPageToken` by a prior `ListLogMetrics` operation. If -// `pageToken` is supplied, then the other fields of this request are -// ignored, and instead the previous `ListLogMetrics` operation is -// continued. -func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall { - c.urlParams_.Set("pageToken", pageToken) - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsMetricsListCall) QuotaUser(quotaUser string) *ProjectsMetricsListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.metrics.list" call. -// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListLogMetricsResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsMetricsListCall) Do() (*ListLogMetricsResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListLogMetricsResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists the logs-based metrics associated with a project.", - // "httpMethod": "GET", - // "id": "logging.projects.metrics.list", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "pageSize": { - // "description": "The maximum number of `LogMetric` objects to return in one operation.", - // "format": "int32", - // "location": "query", - // "type": "integer" - // }, - // "pageToken": { - // "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogMetrics` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogMetrics` operation is continued.", - // "location": "query", - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `projectName`. The resource name for the project whose metrics are wanted.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/metrics", - // "response": { - // "$ref": "ListLogMetricsResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.metrics.update": - -type ProjectsMetricsUpdateCall struct { - s *Service - projectsId string - metricsId string - logmetric *LogMetric - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Update: Creates or updates a logs-based metric. -func (r *ProjectsMetricsService) Update(projectsId string, metricsId string, logmetric *LogMetric) *ProjectsMetricsUpdateCall { - c := &ProjectsMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.metricsId = metricsId - c.logmetric = logmetric - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsMetricsUpdateCall) QuotaUser(quotaUser string) *ProjectsMetricsUpdateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/metrics/{metricsId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("PUT", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "metricsId": c.metricsId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.metrics.update" call. -// Exactly one of *LogMetric or error will be non-nil. Any non-2xx -// status code is an error. Response headers are in either -// *LogMetric.ServerResponse.Header or (if a response was returned at -// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified -// to check whether the returned error was because -// http.StatusNotModified was returned. -func (c *ProjectsMetricsUpdateCall) Do() (*LogMetric, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogMetric{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates or updates a logs-based metric.", - // "httpMethod": "PUT", - // "id": "logging.projects.metrics.update", - // "parameterOrder": [ - // "projectsId", - // "metricsId" - // ], - // "parameters": { - // "metricsId": { - // "description": "Part of `metricName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "projectsId": { - // "description": "Part of `metricName`. The resource name of the metric to update.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/metrics/{metricsId}", - // "request": { - // "$ref": "LogMetric" - // }, - // "response": { - // "$ref": "LogMetric" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.write" - // ] - // } - -} - -// method id "logging.projects.sinks.create": - -type ProjectsSinksCreateCall struct { - s *Service - projectsId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Create: Creates a project sink. A logs filter determines which log -// entries are written to the destination. -func (r *ProjectsSinksService) Create(projectsId string, logsink *LogSink) *ProjectsSinksCreateCall { - c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsSinksCreateCall) QuotaUser(quotaUser string) *ProjectsSinksCreateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("POST", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.sinks.create" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsSinksCreateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Creates a project sink. A logs filter determines which log entries are written to the destination.", - // "httpMethod": "POST", - // "id": "logging.projects.sinks.create", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `projectName`. The resource name of the project to which the sink is bound.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/sinks", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.sinks.delete": - -type ProjectsSinksDeleteCall struct { - s *Service - projectsId string - sinksId string - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Delete: Deletes a project sink. After deletion, no new log entries -// are written to the destination. -func (r *ProjectsSinksService) Delete(projectsId string, sinksId string) *ProjectsSinksDeleteCall { - c := &ProjectsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsSinksDeleteCall) QuotaUser(quotaUser string) *ProjectsSinksDeleteCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("DELETE", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.sinks.delete" call. -// Exactly one of *Empty or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *Empty.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsSinksDeleteCall) Do() (*Empty, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &Empty{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Deletes a project sink. After deletion, no new log entries are written to the destination.", - // "httpMethod": "DELETE", - // "id": "logging.projects.sinks.delete", - // "parameterOrder": [ - // "projectsId", - // "sinksId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the project sink to delete.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", - // "response": { - // "$ref": "Empty" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} - -// method id "logging.projects.sinks.get": - -type ProjectsSinksGetCall struct { - s *Service - projectsId string - sinksId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// Get: Gets a project sink. -func (r *ProjectsSinksService) Get(projectsId string, sinksId string) *ProjectsSinksGetCall { - c := &ProjectsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.sinksId = sinksId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsSinksGetCall) QuotaUser(quotaUser string) *ProjectsSinksGetCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "sinksId": c.sinksId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.sinks.get" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsSinksGetCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Gets a project sink.", - // "httpMethod": "GET", - // "id": "logging.projects.sinks.get", - // "parameterOrder": [ - // "projectsId", - // "sinksId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the project sink to return.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.sinks.list": - -type ProjectsSinksListCall struct { - s *Service - projectsId string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context -} - -// List: Lists project sinks associated with a project. -func (r *ProjectsSinksService) List(projectsId string) *ProjectsSinksListCall { - c := &ProjectsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsSinksListCall) QuotaUser(quotaUser string) *ProjectsSinksListCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets the optional parameter which makes the operation -// fail if the object's ETag matches the given value. This is useful for -// getting updates only after the object has changed since the last -// request. Use googleapi.IsNotModified to check whether the response -// error from Do is the result of In-None-Match. -func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("GET", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - }) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ifNoneMatch_ != "" { - req.Header.Set("If-None-Match", c.ifNoneMatch_) - } - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.sinks.list" call. -// Exactly one of *ListSinksResponse or error will be non-nil. Any -// non-2xx status code is an error. Response headers are in either -// *ListSinksResponse.ServerResponse.Header or (if a response was -// returned at all) in error.(*googleapi.Error).Header. Use -// googleapi.IsNotModified to check whether the returned error was -// because http.StatusNotModified was returned. -func (c *ProjectsSinksListCall) Do() (*ListSinksResponse, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &ListSinksResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Lists project sinks associated with a project.", - // "httpMethod": "GET", - // "id": "logging.projects.sinks.list", - // "parameterOrder": [ - // "projectsId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `projectName`. The project whose sinks are wanted.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/sinks", - // "response": { - // "$ref": "ListSinksResponse" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/cloud-platform.read-only", - // "https://www.googleapis.com/auth/logging.admin", - // "https://www.googleapis.com/auth/logging.read" - // ] - // } - -} - -// method id "logging.projects.sinks.update": - -type ProjectsSinksUpdateCall struct { - s *Service - projectsId string - sinksId string - logsink *LogSink - urlParams_ gensupport.URLParams - ctx_ context.Context -} - -// Update: Updates a project sink. If the sink does not exist, it is -// created. The destination, filter, or both may be updated. -func (r *ProjectsSinksService) Update(projectsId string, sinksId string, logsink *LogSink) *ProjectsSinksUpdateCall { - c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.projectsId = projectsId - c.sinksId = sinksId - c.logsink = logsink - return c -} - -// QuotaUser sets the optional parameter "quotaUser": Available to use -// for quota purposes for server-side applications. Can be any arbitrary -// string assigned to a user, but should not exceed 40 characters. -func (c *ProjectsSinksUpdateCall) QuotaUser(quotaUser string) *ProjectsSinksUpdateCall { - c.urlParams_.Set("quotaUser", quotaUser) - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse -// for more information. -func (c *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// Context sets the context to be used in this call's Do method. Any -// pending HTTP request will be aborted if the provided context is -// canceled. -func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall { - c.ctx_ = ctx - return c -} - -func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) { - var body io.Reader = nil - body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink) - if err != nil { - return nil, err - } - ctype := "application/json" - c.urlParams_.Set("alt", alt) - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/sinks/{sinksId}") - urls += "?" + c.urlParams_.Encode() - req, _ := http.NewRequest("PUT", urls, body) - googleapi.Expand(req.URL, map[string]string{ - "projectsId": c.projectsId, - "sinksId": c.sinksId, - }) - req.Header.Set("Content-Type", ctype) - req.Header.Set("User-Agent", c.s.userAgent()) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) -} - -// Do executes the "logging.projects.sinks.update" call. -// Exactly one of *LogSink or error will be non-nil. Any non-2xx status -// code is an error. Response headers are in either -// *LogSink.ServerResponse.Header or (if a response was returned at all) -// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified -// was returned. -func (c *ProjectsSinksUpdateCall) Do() (*LogSink, error) { - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - } - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, err - } - ret := &LogSink{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - if err := json.NewDecoder(res.Body).Decode(&ret); err != nil { - return nil, err - } - return ret, nil - // { - // "description": "Updates a project sink. If the sink does not exist, it is created. The destination, filter, or both may be updated.", - // "httpMethod": "PUT", - // "id": "logging.projects.sinks.update", - // "parameterOrder": [ - // "projectsId", - // "sinksId" - // ], - // "parameters": { - // "projectsId": { - // "description": "Part of `sinkName`. The resource name of the project sink to update.", - // "location": "path", - // "required": true, - // "type": "string" - // }, - // "sinksId": { - // "description": "Part of `sinkName`. See documentation of `projectsId`.", - // "location": "path", - // "required": true, - // "type": "string" - // } - // }, - // "path": "v1beta3/projects/{projectsId}/sinks/{sinksId}", - // "request": { - // "$ref": "LogSink" - // }, - // "response": { - // "$ref": "LogSink" - // }, - // "scopes": [ - // "https://www.googleapis.com/auth/cloud-platform", - // "https://www.googleapis.com/auth/logging.admin" - // ] - // } - -} diff --git a/components/engine/vendor/google.golang.org/api/option/option.go b/components/engine/vendor/google.golang.org/api/option/option.go new file mode 100644 index 0000000000..f266919747 --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/option/option.go @@ -0,0 +1,142 @@ +// Package option contains options for Google API clients. +package option + +import ( + "net/http" + + "golang.org/x/oauth2" + "google.golang.org/api/internal" + "google.golang.org/grpc" +) + +// A ClientOption is an option for a Google API client. +type ClientOption interface { + Apply(*internal.DialSettings) +} + +// WithTokenSource returns a ClientOption that specifies an OAuth2 token +// source to be used as the basis for authentication. +func WithTokenSource(s oauth2.TokenSource) ClientOption { + return withTokenSource{s} +} + +type withTokenSource struct{ ts oauth2.TokenSource } + +func (w withTokenSource) Apply(o *internal.DialSettings) { + o.TokenSource = w.ts +} + +// WithServiceAccountFile returns a ClientOption that uses a Google service +// account credentials file to authenticate. +// Use WithTokenSource with a token source created from +// golang.org/x/oauth2/google.JWTConfigFromJSON +// if reading the file from disk is not an option. +func WithServiceAccountFile(filename string) ClientOption { + return withServiceAccountFile(filename) +} + +type withServiceAccountFile string + +func (w withServiceAccountFile) Apply(o *internal.DialSettings) { + o.ServiceAccountJSONFilename = string(w) +} + +// WithEndpoint returns a ClientOption that overrides the default endpoint +// to be used for a service. +func WithEndpoint(url string) ClientOption { + return withEndpoint(url) +} + +type withEndpoint string + +func (w withEndpoint) Apply(o *internal.DialSettings) { + o.Endpoint = string(w) +} + +// WithScopes returns a ClientOption that overrides the default OAuth2 scopes +// to be used for a service. +func WithScopes(scope ...string) ClientOption { + return withScopes(scope) +} + +type withScopes []string + +func (w withScopes) Apply(o *internal.DialSettings) { + s := make([]string, len(w)) + copy(s, w) + o.Scopes = s +} + +// WithUserAgent returns a ClientOption that sets the User-Agent. +func WithUserAgent(ua string) ClientOption { + return withUA(ua) +} + +type withUA string + +func (w withUA) Apply(o *internal.DialSettings) { o.UserAgent = string(w) } + +// WithHTTPClient returns a ClientOption that specifies the HTTP client to use +// as the basis of communications. This option may only be used with services +// that support HTTP as their communication transport. When used, the +// WithHTTPClient option takes precedent over all other supplied options. +func WithHTTPClient(client *http.Client) ClientOption { + return withHTTPClient{client} +} + +type withHTTPClient struct{ client *http.Client } + +func (w withHTTPClient) Apply(o *internal.DialSettings) { + o.HTTPClient = w.client +} + +// WithGRPCConn returns a ClientOption that specifies the gRPC client +// connection to use as the basis of communications. This option many only be +// used with services that support gRPC as their communication transport. When +// used, the WithGRPCConn option takes precedent over all other supplied +// options. +func WithGRPCConn(conn *grpc.ClientConn) ClientOption { + return withGRPCConn{conn} +} + +type withGRPCConn struct{ conn *grpc.ClientConn } + +func (w withGRPCConn) Apply(o *internal.DialSettings) { + o.GRPCConn = w.conn +} + +// WithGRPCDialOption returns a ClientOption that appends a new grpc.DialOption +// to an underlying gRPC dial. It does not work with WithGRPCConn. +func WithGRPCDialOption(opt grpc.DialOption) ClientOption { + return withGRPCDialOption{opt} +} + +type withGRPCDialOption struct{ opt grpc.DialOption } + +func (w withGRPCDialOption) Apply(o *internal.DialSettings) { + o.GRPCDialOpts = append(o.GRPCDialOpts, w.opt) +} + +// WithGRPCConnectionPool returns a ClientOption that creates a pool of gRPC +// connections that requests will be balanced between. +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func WithGRPCConnectionPool(size int) ClientOption { + return withGRPCConnectionPool(size) +} + +type withGRPCConnectionPool int + +func (w withGRPCConnectionPool) Apply(o *internal.DialSettings) { + balancer := grpc.RoundRobin(internal.NewPoolResolver(int(w), o)) + o.GRPCDialOpts = append(o.GRPCDialOpts, grpc.WithBalancer(balancer)) +} + +// WithAPIKey returns a ClientOption that specifies an API key to be used +// as the basis for authentication. +func WithAPIKey(apiKey string) ClientOption { + return withAPIKey(apiKey) +} + +type withAPIKey string + +func (w withAPIKey) Apply(o *internal.DialSettings) { o.APIKey = string(w) } diff --git a/components/engine/vendor/google.golang.org/api/support/bundler/bundler.go b/components/engine/vendor/google.golang.org/api/support/bundler/bundler.go new file mode 100644 index 0000000000..4faf13ec02 --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/support/bundler/bundler.go @@ -0,0 +1,261 @@ +// Copyright 2016 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 bundler supports bundling (batching) of items. Bundling amortizes an +// action with fixed costs over multiple items. For example, if an API provides +// an RPC that accepts a list of items as input, but clients would prefer +// adding items one at a time, then a Bundler can accept individual items from +// the client and bundle many of them into a single RPC. +// +// This package is experimental and subject to change without notice. +package bundler + +import ( + "errors" + "reflect" + "sync" + "time" +) + +const ( + DefaultDelayThreshold = time.Second + DefaultBundleCountThreshold = 10 + DefaultBundleByteThreshold = 1e6 // 1M + DefaultBufferedByteLimit = 1e9 // 1G +) + +var ( + // ErrOverflow indicates that Bundler's stored bytes exceeds its BufferedByteLimit. + ErrOverflow = errors.New("bundler reached buffered byte limit") + + // ErrOversizedItem indicates that an item's size exceeds the maximum bundle size. + ErrOversizedItem = errors.New("item size exceeds bundle byte limit") +) + +// A Bundler collects items added to it into a bundle until the bundle +// exceeds a given size, then calls a user-provided function to handle the bundle. +type Bundler struct { + // Starting from the time that the first message is added to a bundle, once + // this delay has passed, handle the bundle. The default is DefaultDelayThreshold. + DelayThreshold time.Duration + + // Once a bundle has this many items, handle the bundle. Since only one + // item at a time is added to a bundle, no bundle will exceed this + // threshold, so it also serves as a limit. The default is + // DefaultBundleCountThreshold. + BundleCountThreshold int + + // Once the number of bytes in current bundle reaches this threshold, handle + // the bundle. The default is DefaultBundleByteThreshold. This triggers handling, + // but does not cap the total size of a bundle. + BundleByteThreshold int + + // The maximum size of a bundle, in bytes. Zero means unlimited. + BundleByteLimit int + + // The maximum number of bytes that the Bundler will keep in memory before + // returning ErrOverflow. The default is DefaultBufferedByteLimit. + BufferedByteLimit int + + handler func(interface{}) // called to handle a bundle + itemSliceZero reflect.Value // nil (zero value) for slice of items + donec chan struct{} // closed when the Bundler is closed + handlec chan int // sent to when a bundle is ready for handling + timer *time.Timer // implements DelayThreshold + + mu sync.Mutex + bufferedSize int // total bytes buffered + closedBundles []bundle // bundles waiting to be handled + curBundle bundle // incoming items added to this bundle + calledc chan struct{} // closed and re-created after handler is called +} + +type bundle struct { + items reflect.Value // slice of item type + size int // size in bytes of all items +} + +// NewBundler creates a new Bundler. When you are finished with a Bundler, call +// its Close method. +// +// itemExample is a value of the type that will be bundled. For example, if you +// want to create bundles of *Entry, you could pass &Entry{} for itemExample. +// +// handler is a function that will be called on each bundle. If itemExample is +// of type T, the argument to handler is of type []T. handler is always called +// sequentially for each bundle, and never in parallel. +func NewBundler(itemExample interface{}, handler func(interface{})) *Bundler { + b := &Bundler{ + DelayThreshold: DefaultDelayThreshold, + BundleCountThreshold: DefaultBundleCountThreshold, + BundleByteThreshold: DefaultBundleByteThreshold, + BufferedByteLimit: DefaultBufferedByteLimit, + + handler: handler, + itemSliceZero: reflect.Zero(reflect.SliceOf(reflect.TypeOf(itemExample))), + donec: make(chan struct{}), + handlec: make(chan int, 1), + calledc: make(chan struct{}), + timer: time.NewTimer(1000 * time.Hour), // harmless initial timeout + } + b.curBundle.items = b.itemSliceZero + go b.background() + return b +} + +// Add adds item to the current bundle. It marks the bundle for handling and +// starts a new one if any of the thresholds or limits are exceeded. +// +// If the item's size exceeds the maximum bundle size (Bundler.BundleByteLimit), then +// the item can never be handled. Add returns ErrOversizedItem in this case. +// +// If adding the item would exceed the maximum memory allowed (Bundler.BufferedByteLimit), +// Add returns ErrOverflow. +// +// Add never blocks. +func (b *Bundler) Add(item interface{}, size int) error { + // If this item exceeds the maximum size of a bundle, + // we can never send it. + if b.BundleByteLimit > 0 && size > b.BundleByteLimit { + return ErrOversizedItem + } + b.mu.Lock() + defer b.mu.Unlock() + // If adding this item would exceed our allotted memory + // footprint, we can't accept it. + if b.bufferedSize+size > b.BufferedByteLimit { + return ErrOverflow + } + // If adding this item to the current bundle would cause it to exceed the + // maximum bundle size, close the current bundle and start a new one. + if b.BundleByteLimit > 0 && b.curBundle.size+size > b.BundleByteLimit { + b.closeAndHandleBundle() + } + // Add the item. + b.curBundle.items = reflect.Append(b.curBundle.items, reflect.ValueOf(item)) + b.curBundle.size += size + b.bufferedSize += size + // If this is the first item in the bundle, restart the timer. + if b.curBundle.items.Len() == 1 { + b.timer.Reset(b.DelayThreshold) + } + // If the current bundle equals the count threshold, close it. + if b.curBundle.items.Len() == b.BundleCountThreshold { + b.closeAndHandleBundle() + } + // If the current bundle equals or exceeds the byte threshold, close it. + if b.curBundle.size >= b.BundleByteThreshold { + b.closeAndHandleBundle() + } + return nil +} + +// Flush waits until all items in the Bundler have been handled (that is, +// until the last invocation of handler has returned). +func (b *Bundler) Flush() { + b.mu.Lock() + b.closeBundle() + // Unconditionally trigger the handling goroutine, to ensure calledc is closed + // even if there are no outstanding bundles. + select { + case b.handlec <- 1: + default: + } + calledc := b.calledc // remember locally, because it may change + b.mu.Unlock() + <-calledc +} + +// Close calls Flush, then shuts down the Bundler. Close should always be +// called on a Bundler when it is no longer needed. You must wait for all calls +// to Add to complete before calling Close. Calling Add concurrently with Close +// may result in the added items being ignored. +func (b *Bundler) Close() { + b.Flush() + b.mu.Lock() + b.timer.Stop() + b.mu.Unlock() + close(b.donec) +} + +func (b *Bundler) closeAndHandleBundle() { + if b.closeBundle() { + // We have created a closed bundle. + // Send to handlec without blocking. + select { + case b.handlec <- 1: + default: + } + } +} + +// closeBundle finishes the current bundle, adds it to the list of closed +// bundles and informs the background goroutine that there are bundles ready +// for processing. +// +// This should always be called with b.mu held. +func (b *Bundler) closeBundle() bool { + if b.curBundle.items.Len() == 0 { + return false + } + b.closedBundles = append(b.closedBundles, b.curBundle) + b.curBundle.items = b.itemSliceZero + b.curBundle.size = 0 + return true +} + +// background runs in a separate goroutine, waiting for events and handling +// bundles. +func (b *Bundler) background() { + done := false + for { + timedOut := false + // Wait for something to happen. + select { + case <-b.handlec: + case <-b.donec: + done = true + case <-b.timer.C: + timedOut = true + } + // Handle closed bundles. + b.mu.Lock() + if timedOut { + b.closeBundle() + } + buns := b.closedBundles + b.closedBundles = nil + // Closing calledc means we've sent all bundles. We need + // a new channel for the next set of bundles, which may start + // accumulating as soon as we release the lock. + calledc := b.calledc + b.calledc = make(chan struct{}) + b.mu.Unlock() + for i, bun := range buns { + b.handler(bun.items.Interface()) + // Drop the bundle's items, reducing our memory footprint. + buns[i].items = reflect.Value{} // buns[i] because bun is a copy + // Note immediately that we have more space, so Adds that occur + // during this loop will have a chance of succeeding. + b.mu.Lock() + b.bufferedSize -= bun.size + b.mu.Unlock() + } + // Signal that we've sent all outstanding bundles. + close(calledc) + if done { + break + } + } +} diff --git a/components/engine/vendor/google.golang.org/api/transport/dial.go b/components/engine/vendor/google.golang.org/api/transport/dial.go new file mode 100644 index 0000000000..9971eb879c --- /dev/null +++ b/components/engine/vendor/google.golang.org/api/transport/dial.go @@ -0,0 +1,134 @@ +// Copyright 2015 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 transport supports network connections to HTTP and GRPC servers. +// This package is not intended for use by end developers. Use the +// google.golang.org/api/option package to configure API clients. +package transport + +import ( + "errors" + "fmt" + "io/ioutil" + "net/http" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/oauth" + + gtransport "google.golang.org/api/googleapi/transport" + "google.golang.org/api/internal" + "google.golang.org/api/option" +) + +// NewHTTPClient returns an HTTP client for use communicating with a Google cloud +// service, configured with the given ClientOptions. It also returns the endpoint +// for the service as specified in the options. +func NewHTTPClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, string, error) { + var o internal.DialSettings + for _, opt := range opts { + opt.Apply(&o) + } + if o.GRPCConn != nil { + return nil, "", errors.New("unsupported gRPC connection specified") + } + // TODO(djd): Set UserAgent on all outgoing requests. + if o.HTTPClient != nil { + return o.HTTPClient, o.Endpoint, nil + } + if o.APIKey != "" { + hc := &http.Client{ + Transport: >ransport.APIKey{ + Key: o.APIKey, + Transport: http.DefaultTransport, + }, + } + return hc, o.Endpoint, nil + } + if o.ServiceAccountJSONFilename != "" { + ts, err := serviceAcctTokenSource(ctx, o.ServiceAccountJSONFilename, o.Scopes...) + if err != nil { + return nil, "", err + } + o.TokenSource = ts + } + if o.TokenSource == nil { + var err error + o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) + if err != nil { + return nil, "", fmt.Errorf("google.DefaultTokenSource: %v", err) + } + } + return oauth2.NewClient(ctx, o.TokenSource), o.Endpoint, nil +} + +// Set at init time by dial_appengine.go. If nil, we're not on App Engine. +var appengineDialerHook func(context.Context) grpc.DialOption + +// DialGRPC returns a GRPC connection for use communicating with a Google cloud +// service, configured with the given ClientOptions. +func DialGRPC(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) { + var o internal.DialSettings + for _, opt := range opts { + opt.Apply(&o) + } + if o.HTTPClient != nil { + return nil, errors.New("unsupported HTTP client specified") + } + if o.GRPCConn != nil { + return o.GRPCConn, nil + } + if o.ServiceAccountJSONFilename != "" { + ts, err := serviceAcctTokenSource(ctx, o.ServiceAccountJSONFilename, o.Scopes...) + if err != nil { + return nil, err + } + o.TokenSource = ts + } + if o.TokenSource == nil { + var err error + o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) + if err != nil { + return nil, fmt.Errorf("google.DefaultTokenSource: %v", err) + } + } + grpcOpts := []grpc.DialOption{ + grpc.WithPerRPCCredentials(oauth.TokenSource{o.TokenSource}), + grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), + } + if appengineDialerHook != nil { + // Use the Socket API on App Engine. + grpcOpts = append(grpcOpts, appengineDialerHook(ctx)) + } + grpcOpts = append(grpcOpts, o.GRPCDialOpts...) + if o.UserAgent != "" { + grpcOpts = append(grpcOpts, grpc.WithUserAgent(o.UserAgent)) + } + return grpc.DialContext(ctx, o.Endpoint, grpcOpts...) +} + +func serviceAcctTokenSource(ctx context.Context, filename string, scope ...string) (oauth2.TokenSource, error) { + data, err := ioutil.ReadFile(filename) + if err != nil { + return nil, fmt.Errorf("cannot read service account file: %v", err) + } + cfg, err := google.JWTConfigFromJSON(data, scope...) + if err != nil { + return nil, fmt.Errorf("google.JWTConfigFromJSON: %v", err) + } + return cfg.TokenSource(ctx), nil +} diff --git a/components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go b/components/engine/vendor/google.golang.org/api/transport/dial_appengine.go similarity index 54% rename from components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go rename to components/engine/vendor/google.golang.org/api/transport/dial_appengine.go index c11a4ddebc..201244d249 100644 --- a/components/engine/vendor/google.golang.org/cloud/internal/transport/cancelreq_legacy.go +++ b/components/engine/vendor/google.golang.org/api/transport/dial_appengine.go @@ -1,4 +1,4 @@ -// Copyright 2015 Google Inc. All Rights Reserved. +// Copyright 2016 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. @@ -12,20 +12,23 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !go1.5 +// +build appengine package transport -import "net/http" +import ( + "net" + "time" -// makeReqCancel returns a closure that cancels the given http.Request -// when called. -func makeReqCancel(req *http.Request) func(http.RoundTripper) { - // Go 1.4 and prior do not have a reliable way of cancelling a request. - // Transport.CancelRequest will only work if the request is already in-flight. - return func(r http.RoundTripper) { - if t, ok := r.(*http.Transport); ok { - t.CancelRequest(req) - } + "golang.org/x/net/context" + "google.golang.org/appengine/socket" + "google.golang.org/grpc" +) + +func init() { + appengineDialerHook = func(ctx context.Context) grpc.DialOption { + return grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) { + return socket.DialTimeout(ctx, "tcp", addr, timeout) + }) } } diff --git a/components/engine/vendor/google.golang.org/cloud/cloud.go b/components/engine/vendor/google.golang.org/cloud/cloud.go deleted file mode 100644 index 96d36baf2c..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/cloud.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2014 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 cloud contains Google Cloud Platform APIs related types -// and common functions. -package cloud // import "google.golang.org/cloud" - -import ( - "net/http" - - "golang.org/x/net/context" - "google.golang.org/cloud/internal" -) - -// NewContext returns a new context that uses the provided http.Client. -// Provided http.Client is responsible to authorize and authenticate -// the requests made to the Google Cloud APIs. -// It mutates the client's original Transport to append the cloud -// package's user-agent to the outgoing requests. -// You can obtain the project ID from the Google Developers Console, -// https://console.developers.google.com. -func NewContext(projID string, c *http.Client) context.Context { - if c == nil { - panic("invalid nil *http.Client passed to NewContext") - } - return WithContext(context.Background(), projID, c) -} - -// WithContext returns a new context in a similar way NewContext does, -// but initiates the new context with the specified parent. -func WithContext(parent context.Context, projID string, c *http.Client) context.Context { - // TODO(bradfitz): delete internal.Transport. It's too wrappy for what it does. - // Do User-Agent some other way. - if _, ok := c.Transport.(*internal.Transport); !ok { - c.Transport = &internal.Transport{Base: c.Transport} - } - return internal.WithContext(parent, projID, c) -} diff --git a/components/engine/vendor/google.golang.org/cloud/internal/cloud.go b/components/engine/vendor/google.golang.org/cloud/internal/cloud.go deleted file mode 100644 index 8b0db1b5da..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/internal/cloud.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2014 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 internal provides support for the cloud packages. -// -// Users should not import this package directly. -package internal - -import ( - "fmt" - "net/http" - "sync" - - "golang.org/x/net/context" -) - -type contextKey struct{} - -func WithContext(parent context.Context, projID string, c *http.Client) context.Context { - if c == nil { - panic("nil *http.Client passed to WithContext") - } - if projID == "" { - panic("empty project ID passed to WithContext") - } - return context.WithValue(parent, contextKey{}, &cloudContext{ - ProjectID: projID, - HTTPClient: c, - }) -} - -const userAgent = "gcloud-golang/0.1" - -type cloudContext struct { - ProjectID string - HTTPClient *http.Client - - mu sync.Mutex // guards svc - svc map[string]interface{} // e.g. "storage" => *rawStorage.Service -} - -// Service returns the result of the fill function if it's never been -// called before for the given name (which is assumed to be an API -// service name, like "datastore"). If it has already been cached, the fill -// func is not run. -// It's safe for concurrent use by multiple goroutines. -func Service(ctx context.Context, name string, fill func(*http.Client) interface{}) interface{} { - return cc(ctx).service(name, fill) -} - -func (c *cloudContext) service(name string, fill func(*http.Client) interface{}) interface{} { - c.mu.Lock() - defer c.mu.Unlock() - - if c.svc == nil { - c.svc = make(map[string]interface{}) - } else if v, ok := c.svc[name]; ok { - return v - } - v := fill(c.HTTPClient) - c.svc[name] = v - return v -} - -// Transport is an http.RoundTripper that appends -// Google Cloud client's user-agent to the original -// request's user-agent header. -type Transport struct { - // Base represents the actual http.RoundTripper - // the requests will be delegated to. - Base http.RoundTripper -} - -// RoundTrip appends a user-agent to the existing user-agent -// header and delegates the request to the base http.RoundTripper. -func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { - req = cloneRequest(req) - ua := req.Header.Get("User-Agent") - if ua == "" { - ua = userAgent - } else { - ua = fmt.Sprintf("%s %s", ua, userAgent) - } - req.Header.Set("User-Agent", ua) - return t.Base.RoundTrip(req) -} - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header) - for k, s := range r.Header { - r2.Header[k] = s - } - return r2 -} - -func ProjID(ctx context.Context) string { - return cc(ctx).ProjectID -} - -func HTTPClient(ctx context.Context) *http.Client { - return cc(ctx).HTTPClient -} - -// cc returns the internal *cloudContext (cc) state for a context.Context. -// It panics if the user did it wrong. -func cc(ctx context.Context) *cloudContext { - if c, ok := ctx.Value(contextKey{}).(*cloudContext); ok { - return c - } - panic("invalid context.Context type; it should be created with cloud.NewContext") -} diff --git a/components/engine/vendor/google.golang.org/cloud/internal/opts/option.go b/components/engine/vendor/google.golang.org/cloud/internal/opts/option.go deleted file mode 100644 index c5ccf4f56d..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/internal/opts/option.go +++ /dev/null @@ -1,24 +0,0 @@ -// Package opts holds the DialOpts struct, configurable by -// cloud.ClientOptions to set up transports for cloud packages. -// -// This is a separate page to prevent cycles between the core -// cloud packages. -package opts - -import ( - "net/http" - - "golang.org/x/oauth2" - "google.golang.org/grpc" -) - -type DialOpt struct { - Endpoint string - Scopes []string - UserAgent string - - TokenSource oauth2.TokenSource - - HTTPClient *http.Client - GRPCClient *grpc.ClientConn -} diff --git a/components/engine/vendor/google.golang.org/cloud/internal/transport/dial.go b/components/engine/vendor/google.golang.org/cloud/internal/transport/dial.go deleted file mode 100644 index 29624410d3..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/internal/transport/dial.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2015 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 transport - -import ( - "errors" - "fmt" - "net/http" - - "golang.org/x/net/context" - "golang.org/x/oauth2" - "golang.org/x/oauth2/google" - "google.golang.org/cloud" - "google.golang.org/cloud/internal/opts" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/oauth" -) - -// ErrHTTP is returned when on a non-200 HTTP response. -type ErrHTTP struct { - StatusCode int - Body []byte - err error -} - -func (e *ErrHTTP) Error() string { - if e.err == nil { - return fmt.Sprintf("error during call, http status code: %v %s", e.StatusCode, e.Body) - } - return e.err.Error() -} - -// NewHTTPClient returns an HTTP client for use communicating with a Google cloud -// service, configured with the given ClientOptions. It also returns the endpoint -// for the service as specified in the options. -func NewHTTPClient(ctx context.Context, opt ...cloud.ClientOption) (*http.Client, string, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.GRPCClient != nil { - return nil, "", errors.New("unsupported GRPC base transport specified") - } - // TODO(djd): Wrap all http.Clients with appropriate internal version to add - // UserAgent header and prepend correct endpoint. - if o.HTTPClient != nil { - return o.HTTPClient, o.Endpoint, nil - } - if o.TokenSource == nil { - var err error - o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) - if err != nil { - return nil, "", fmt.Errorf("google.DefaultTokenSource: %v", err) - } - } - return oauth2.NewClient(ctx, o.TokenSource), o.Endpoint, nil -} - -// NewProtoClient returns a ProtoClient for communicating with a Google cloud service, -// configured with the given ClientOptions. -func NewProtoClient(ctx context.Context, opt ...cloud.ClientOption) (*ProtoClient, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.GRPCClient != nil { - return nil, errors.New("unsupported GRPC base transport specified") - } - var client *http.Client - switch { - case o.HTTPClient != nil: - if o.TokenSource != nil { - return nil, errors.New("at most one of WithTokenSource or WithBaseHTTP may be provided") - } - client = o.HTTPClient - case o.TokenSource != nil: - client = oauth2.NewClient(ctx, o.TokenSource) - default: - var err error - client, err = google.DefaultClient(ctx, o.Scopes...) - if err != nil { - return nil, err - } - } - - return &ProtoClient{ - client: client, - endpoint: o.Endpoint, - userAgent: o.UserAgent, - }, nil -} - -// DialGRPC returns a GRPC connection for use communicating with a Google cloud -// service, configured with the given ClientOptions. -func DialGRPC(ctx context.Context, opt ...cloud.ClientOption) (*grpc.ClientConn, error) { - var o opts.DialOpt - for _, opt := range opt { - opt.Resolve(&o) - } - if o.HTTPClient != nil { - return nil, errors.New("unsupported HTTP base transport specified") - } - if o.GRPCClient != nil { - return o.GRPCClient, nil - } - if o.TokenSource == nil { - var err error - o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...) - if err != nil { - return nil, fmt.Errorf("google.DefaultTokenSource: %v", err) - } - } - grpcOpts := []grpc.DialOption{ - grpc.WithPerRPCCredentials(oauth.TokenSource{o.TokenSource}), - grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(nil, "")), - } - if o.UserAgent != "" { - grpcOpts = append(grpcOpts, grpc.WithUserAgent(o.UserAgent)) - } - return grpc.Dial(o.Endpoint, grpcOpts...) -} diff --git a/components/engine/vendor/google.golang.org/cloud/internal/transport/proto.go b/components/engine/vendor/google.golang.org/cloud/internal/transport/proto.go deleted file mode 100644 index 05b11cde1e..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/internal/transport/proto.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2015 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 transport - -import ( - "bytes" - "io/ioutil" - "net/http" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" -) - -type ProtoClient struct { - client *http.Client - endpoint string - userAgent string -} - -func (c *ProtoClient) Call(ctx context.Context, method string, req, resp proto.Message) error { - payload, err := proto.Marshal(req) - if err != nil { - return err - } - - httpReq, err := http.NewRequest("POST", c.endpoint+method, bytes.NewReader(payload)) - if err != nil { - return err - } - httpReq.Header.Set("Content-Type", "application/x-protobuf") - if ua := c.userAgent; ua != "" { - httpReq.Header.Set("User-Agent", ua) - } - - errc := make(chan error, 1) - cancel := makeReqCancel(httpReq) - - go func() { - r, err := c.client.Do(httpReq) - if err != nil { - errc <- err - return - } - defer r.Body.Close() - - body, err := ioutil.ReadAll(r.Body) - if r.StatusCode != http.StatusOK { - err = &ErrHTTP{ - StatusCode: r.StatusCode, - Body: body, - err: err, - } - } - if err != nil { - errc <- err - return - } - errc <- proto.Unmarshal(body, resp) - }() - - select { - case <-ctx.Done(): - cancel(c.client.Transport) // Cancel the HTTP request. - return ctx.Err() - case err := <-errc: - return err - } -} diff --git a/components/engine/vendor/google.golang.org/cloud/logging/logging.go b/components/engine/vendor/google.golang.org/cloud/logging/logging.go deleted file mode 100644 index bd33e26ecf..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/logging/logging.go +++ /dev/null @@ -1,468 +0,0 @@ -// Copyright 2015 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 logging contains a Google Cloud Logging client. -// -// This package is experimental and subject to API changes. -package logging // import "google.golang.org/cloud/logging" - -import ( - "errors" - "io" - "log" - "sync" - "time" - - "golang.org/x/net/context" - api "google.golang.org/api/logging/v1beta3" - "google.golang.org/cloud" - "google.golang.org/cloud/internal/transport" -) - -// Scope is the OAuth2 scope necessary to use Google Cloud Logging. -const Scope = api.LoggingWriteScope - -// Level is the log level. -type Level int - -const ( - // Default means no assigned severity level. - Default Level = iota - Debug - Info - Warning - Error - Critical - Alert - Emergency - nLevel -) - -var levelName = [nLevel]string{ - Default: "", - Debug: "DEBUG", - Info: "INFO", - Warning: "WARNING", - Error: "ERROR", - Critical: "CRITICAL", - Alert: "ALERT", - Emergency: "EMERGENCY", -} - -func (v Level) String() string { - return levelName[v] -} - -// Client is a Google Cloud Logging client. -// It must be constructed via NewClient. -type Client struct { - svc *api.Service - logs *api.ProjectsLogsEntriesService - projID string - logName string - writer [nLevel]io.Writer - logger [nLevel]*log.Logger - - mu sync.Mutex - queued []*api.LogEntry - curFlush *flushCall // currently in-flight flush - flushTimer *time.Timer // nil before first use - timerActive bool // whether flushTimer is armed - inFlight int // number of log entries sent to API service but not yet ACKed - - // For testing: - timeNow func() time.Time // optional - - // ServiceName may be "appengine.googleapis.com", - // "compute.googleapis.com" or "custom.googleapis.com". - // - // The default is "custom.googleapis.com". - // - // The service name is only used by the API server to - // determine which of the labels are used to index the logs. - ServiceName string - - // CommonLabels are metadata labels that apply to all log - // entries in this request, so that you don't have to repeat - // them in each log entry's metadata.labels field. If any of - // the log entries contains a (key, value) with the same key - // that is in CommonLabels, then the entry's (key, value) - // overrides the one in CommonLabels. - CommonLabels map[string]string - - // BufferLimit is the maximum number of items to keep in memory - // before flushing. Zero means automatic. A value of 1 means to - // flush after each log entry. - // The default is currently 10,000. - BufferLimit int - - // FlushAfter optionally specifies a threshold count at which buffered - // log entries are flushed, even if the BufferInterval has not yet - // been reached. - // The default is currently 10. - FlushAfter int - - // BufferInterval is the maximum amount of time that an item - // should remain buffered in memory before being flushed to - // the logging service. - // The default is currently 1 second. - BufferInterval time.Duration - - // Overflow is a function which runs when the Log function - // overflows its configured buffer limit. If nil, the log - // entry is dropped. The return value from Overflow is - // returned by Log. - Overflow func(*Client, Entry) error -} - -func (c *Client) flushAfter() int { - if v := c.FlushAfter; v > 0 { - return v - } - return 10 -} - -func (c *Client) bufferInterval() time.Duration { - if v := c.BufferInterval; v > 0 { - return v - } - return time.Second -} - -func (c *Client) bufferLimit() int { - if v := c.BufferLimit; v > 0 { - return v - } - return 10000 -} - -func (c *Client) serviceName() string { - if v := c.ServiceName; v != "" { - return v - } - return "custom.googleapis.com" -} - -func (c *Client) now() time.Time { - if now := c.timeNow; now != nil { - return now() - } - return time.Now() -} - -// Writer returns an io.Writer for the provided log level. -// -// Each Write call on the returned Writer generates a log entry. -// -// This Writer accessor does not allocate, so callers do not need to -// cache. -func (c *Client) Writer(v Level) io.Writer { return c.writer[v] } - -// Logger returns a *log.Logger for the provided log level. -// -// A Logger for each Level is pre-allocated by NewClient with an empty -// prefix and no flags. This Logger accessor does not allocate. -// Callers wishing to use alternate flags (such as log.Lshortfile) may -// mutate the returned Logger with SetFlags. Such mutations affect all -// callers in the program. -func (c *Client) Logger(v Level) *log.Logger { return c.logger[v] } - -type levelWriter struct { - level Level - c *Client -} - -func (w levelWriter) Write(p []byte) (n int, err error) { - return len(p), w.c.Log(Entry{ - Level: w.level, - Payload: string(p), - }) -} - -// Entry is a log entry. -type Entry struct { - // Time is the time of the entry. If the zero value, the current time is used. - Time time.Time - - // Level is log entry's severity level. - // The zero value means no assigned severity level. - Level Level - - // Payload must be either a string, []byte, or something that - // marshals via the encoding/json package to a JSON object - // (and not any other type of JSON value). - Payload interface{} - - // Labels optionally specifies key/value labels for the log entry. - // Depending on the Client's ServiceName, these are indexed differently - // by the Cloud Logging Service. - // See https://cloud.google.com/logging/docs/logs_index - // The Client.Log method takes ownership of this map. - Labels map[string]string - - // TODO: de-duping id -} - -func (c *Client) apiEntry(e Entry) (*api.LogEntry, error) { - t := e.Time - if t.IsZero() { - t = c.now() - } - - ent := &api.LogEntry{ - Metadata: &api.LogEntryMetadata{ - Timestamp: t.UTC().Format(time.RFC3339Nano), - ServiceName: c.serviceName(), - Severity: e.Level.String(), - Labels: e.Labels, - }, - } - switch p := e.Payload.(type) { - case string: - ent.TextPayload = p - case []byte: - ent.TextPayload = string(p) - default: - ent.StructPayload = api.LogEntryStructPayload(p) - } - return ent, nil -} - -// LogSync logs e synchronously without any buffering. -// This is mostly intended for debugging or critical errors. -func (c *Client) LogSync(e Entry) error { - ent, err := c.apiEntry(e) - if err != nil { - return err - } - _, err = c.logs.Write(c.projID, c.logName, &api.WriteLogEntriesRequest{ - CommonLabels: c.CommonLabels, - Entries: []*api.LogEntry{ent}, - }).Do() - return err -} - -var ErrOverflow = errors.New("logging: log entry overflowed buffer limits") - -// Log queues an entry to be sent to the logging service, subject to the -// Client's parameters. By default, the log will be flushed within -// one second. -// Log only returns an error if the entry is invalid or the queue is at -// capacity. If the queue is at capacity and the entry can't be added, -// Log returns either ErrOverflow when c.Overflow is nil, or the -// value returned by c.Overflow. -func (c *Client) Log(e Entry) error { - ent, err := c.apiEntry(e) - if err != nil { - return err - } - - c.mu.Lock() - buffered := len(c.queued) + c.inFlight - - if buffered >= c.bufferLimit() { - c.mu.Unlock() - if fn := c.Overflow; fn != nil { - return fn(c, e) - } - return ErrOverflow - } - defer c.mu.Unlock() - - c.queued = append(c.queued, ent) - if len(c.queued) >= c.flushAfter() { - c.scheduleFlushLocked(0) - return nil - } - c.scheduleFlushLocked(c.bufferInterval()) - return nil -} - -// c.mu must be held. -// -// d will be one of two values: either c.BufferInterval (or its -// default value) or 0. -func (c *Client) scheduleFlushLocked(d time.Duration) { - if c.inFlight > 0 { - // For now to keep things simple, only allow one HTTP - // request in flight at a time. - return - } - switch { - case c.flushTimer == nil: - // First flush. - c.timerActive = true - c.flushTimer = time.AfterFunc(d, c.timeoutFlush) - case c.timerActive && d == 0: - // Make it happen sooner. For example, this is the - // case of transitioning from a 1 second flush after - // the 1st item to an immediate flush after the 10th - // item. - c.flushTimer.Reset(0) - case !c.timerActive: - c.timerActive = true - c.flushTimer.Reset(d) - default: - // else timer was already active, also at d > 0, - // so we don't touch it and let it fire as previously - // scheduled. - } -} - -// timeoutFlush runs in its own goroutine (from time.AfterFunc) and -// flushes c.queued. -func (c *Client) timeoutFlush() { - c.mu.Lock() - c.timerActive = false - c.mu.Unlock() - if err := c.Flush(); err != nil { - // schedule another try - // TODO: smarter back-off? - c.mu.Lock() - c.scheduleFlushLocked(5 * time.Second) - c.mu.Unlock() - } -} - -// Ping reports whether the client's connection to Google Cloud -// Logging and the authentication configuration are valid. -func (c *Client) Ping() error { - _, err := c.logs.Write(c.projID, c.logName, &api.WriteLogEntriesRequest{ - Entries: []*api.LogEntry{}, - }).Do() - return err -} - -// Flush flushes any buffered log entries. -func (c *Client) Flush() error { - var numFlush int - c.mu.Lock() - for { - // We're already flushing (or we just started flushing - // ourselves), so wait for it to finish. - if f := c.curFlush; f != nil { - wasEmpty := len(c.queued) == 0 - c.mu.Unlock() - <-f.donec // wait for it - numFlush++ - // Terminate whenever there's an error, we've - // already flushed twice (one that was already - // in-flight when flush was called, and then - // one we instigated), or the queue was empty - // when we released the locked (meaning this - // in-flight flush removes everything present - // when Flush was called, and we don't need to - // kick off a new flush for things arriving - // afterward) - if f.err != nil || numFlush == 2 || wasEmpty { - return f.err - } - // Otherwise, re-obtain the lock and loop, - // starting over with seeing if a flush is in - // progress, which might've been started by a - // different goroutine before aquiring this - // lock again. - c.mu.Lock() - continue - } - - // Terminal case: - if len(c.queued) == 0 { - c.mu.Unlock() - return nil - } - - c.startFlushLocked() - } -} - -// requires c.mu be held. -func (c *Client) startFlushLocked() { - if c.curFlush != nil { - panic("internal error: flush already in flight") - } - if len(c.queued) == 0 { - panic("internal error: no items queued") - } - logEntries := c.queued - c.inFlight = len(logEntries) - c.queued = nil - - flush := &flushCall{ - donec: make(chan struct{}), - } - c.curFlush = flush - go func() { - defer close(flush.donec) - _, err := c.logs.Write(c.projID, c.logName, &api.WriteLogEntriesRequest{ - CommonLabels: c.CommonLabels, - Entries: logEntries, - }).Do() - flush.err = err - c.mu.Lock() - defer c.mu.Unlock() - c.inFlight = 0 - c.curFlush = nil - if err != nil { - c.queued = append(c.queued, logEntries...) - } else if len(c.queued) > 0 { - c.scheduleFlushLocked(c.bufferInterval()) - } - }() - -} - -const prodAddr = "https://logging.googleapis.com/" - -const userAgent = "gcloud-golang-logging/20150922" - -// NewClient returns a new log client, logging to the named log in the -// provided project. -// -// The exported fields on the returned client may be modified before -// the client is used for logging. Once log entries are in flight, -// the fields must not be modified. -func NewClient(ctx context.Context, projectID, logName string, opts ...cloud.ClientOption) (*Client, error) { - httpClient, endpoint, err := transport.NewHTTPClient(ctx, append([]cloud.ClientOption{ - cloud.WithEndpoint(prodAddr), - cloud.WithScopes(api.CloudPlatformScope), - cloud.WithUserAgent(userAgent), - }, opts...)...) - if err != nil { - return nil, err - } - svc, err := api.New(httpClient) - if err != nil { - return nil, err - } - svc.BasePath = endpoint - c := &Client{ - svc: svc, - logs: api.NewProjectsLogsEntriesService(svc), - logName: logName, - projID: projectID, - } - for i := range c.writer { - level := Level(i) - c.writer[level] = levelWriter{level, c} - c.logger[level] = log.New(c.writer[level], "", 0) - } - return c, nil -} - -// flushCall is an in-flight or completed flush. -type flushCall struct { - donec chan struct{} // closed when response is in - err error // error is valid after wg is Done -} diff --git a/components/engine/vendor/google.golang.org/cloud/option.go b/components/engine/vendor/google.golang.org/cloud/option.go deleted file mode 100644 index d8614eb206..0000000000 --- a/components/engine/vendor/google.golang.org/cloud/option.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2015 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 cloud - -import ( - "net/http" - - "golang.org/x/oauth2" - "google.golang.org/cloud/internal/opts" - "google.golang.org/grpc" -) - -// ClientOption is used when construct clients for each cloud service. -type ClientOption interface { - // Resolve configures the given DialOpts for this option. - Resolve(*opts.DialOpt) -} - -// WithTokenSource returns a ClientOption that specifies an OAuth2 token -// source to be used as the basis for authentication. -func WithTokenSource(s oauth2.TokenSource) ClientOption { - return withTokenSource{s} -} - -type withTokenSource struct{ ts oauth2.TokenSource } - -func (w withTokenSource) Resolve(o *opts.DialOpt) { - o.TokenSource = w.ts -} - -// WithEndpoint returns a ClientOption that overrides the default endpoint -// to be used for a service. -func WithEndpoint(url string) ClientOption { - return withEndpoint(url) -} - -type withEndpoint string - -func (w withEndpoint) Resolve(o *opts.DialOpt) { - o.Endpoint = string(w) -} - -// WithScopes returns a ClientOption that overrides the default OAuth2 scopes -// to be used for a service. -func WithScopes(scope ...string) ClientOption { - return withScopes(scope) -} - -type withScopes []string - -func (w withScopes) Resolve(o *opts.DialOpt) { - s := make([]string, len(w)) - copy(s, w) - o.Scopes = s -} - -// WithUserAgent returns a ClientOption that sets the User-Agent. -func WithUserAgent(ua string) ClientOption { - return withUA(ua) -} - -type withUA string - -func (w withUA) Resolve(o *opts.DialOpt) { o.UserAgent = string(w) } - -// WithBaseHTTP returns a ClientOption that specifies the HTTP client to -// use as the basis of communications. This option may only be used with -// services that support HTTP as their communication transport. -func WithBaseHTTP(client *http.Client) ClientOption { - return withBaseHTTP{client} -} - -type withBaseHTTP struct{ client *http.Client } - -func (w withBaseHTTP) Resolve(o *opts.DialOpt) { - o.HTTPClient = w.client -} - -// WithBaseGRPC returns a ClientOption that specifies the GRPC client -// connection to use as the basis of communications. This option many only be -// used with services that support HRPC as their communication transport. -func WithBaseGRPC(client *grpc.ClientConn) ClientOption { - return withBaseGRPC{client} -} - -type withBaseGRPC struct{ client *grpc.ClientConn } - -func (w withBaseGRPC) Resolve(o *opts.DialOpt) { - o.GRPCClient = w.client -} diff --git a/components/engine/vendor/google.golang.org/genproto/LICENSE b/components/engine/vendor/google.golang.org/genproto/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/components/engine/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/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go new file mode 100644 index 0000000000..1f9fa68798 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.pb.go @@ -0,0 +1,100 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/label/label.proto +// DO NOT EDIT! + +/* +Package google_api is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/api/label/label.proto + +It has these top-level messages: + LabelDescriptor +*/ +package google_api // import "google.golang.org/genproto/googleapis/api/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 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.golang.org/genproto/googleapis/api/label/label.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 240 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0x9c, 0xc4, 0xa4, 0xd4, 0x1c, 0x08, 0xa9, 0x07, 0x56, 0x20, 0xc4, 0x05, 0xd5, 0x0c, 0x94, + 0x55, 0xda, 0xc9, 0xc8, 0xc5, 0xef, 0x03, 0x92, 0x73, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, + 0xc9, 0x2f, 0x12, 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, + 0x02, 0x31, 0x85, 0x5c, 0xb8, 0xb8, 0xca, 0x12, 0x73, 0x4a, 0x53, 0xe3, 0x4b, 0x2a, 0x0b, 0x52, + 0x25, 0x98, 0x80, 0x12, 0x7c, 0x46, 0xaa, 0x7a, 0x08, 0x63, 0xf4, 0xd0, 0x8c, 0xd0, 0x0b, 0x03, + 0xa9, 0x0e, 0x01, 0x2a, 0x0e, 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, 0x69, 0x70, 0xf1, 0x25, 0xe7, 0xe7, 0x22, 0x39, 0xc3, 0x89, 0x0b, 0xec, 0x8e, 0x00, 0x90, + 0x2f, 0x03, 0x18, 0x7f, 0x30, 0x32, 0x2e, 0x62, 0x62, 0x71, 0x77, 0x0c, 0xf0, 0x4c, 0x62, 0x03, + 0x7b, 0xdc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xca, 0x32, 0x56, 0x5f, 0x37, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.proto new file mode 100644 index 0000000000..fec98121c3 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/label/label.proto @@ -0,0 +1,48 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_outer_classname = "LabelProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// A description of a label. +message LabelDescriptor { + // Value types that can be used as label values. + enum ValueType { + // A variable-length string. This is the default. + STRING = 0; + + // Boolean; true or false. + BOOL = 1; + + // A 64-bit signed integer. + INT64 = 2; + } + + // The label key. + string key = 1; + + // The type of data that can be assigned to the label. + ValueType value_type = 2; + + // A human-readable description for the label. + string description = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go new file mode 100644 index 0000000000..32967e0cd9 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.pb.go @@ -0,0 +1,303 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/metric/metric.proto +// DO NOT EDIT! + +/* +Package google_api is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/api/metric/metric.proto + +It has these top-level messages: + MetricDescriptor + Metric +*/ +package google_api // import "google.golang.org/genproto/googleapis/api/metric" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api1 "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. +type MetricDescriptor struct { + // Resource name. The format of the name may vary between different + // implementations. For examples: + // + // projects/{project_id}/metricDescriptors/{type=**} + // metricDescriptors/{type=**} + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The metric type including a DNS name prefix, for example + // `"compute.googleapis.com/instance/cpu/utilization"`. Metric types + // should use a natural hierarchical grouping such as the following: + // + // compute.googleapis.com/instance/cpu/utilization + // compute.googleapis.com/instance/disk/read_ops_count + // compute.googleapis.com/instance/network/received_bytes_count + // + // Note that if the metric type changes, the monitoring data will be + // discontinued, and anything depends on it will break, such as monitoring + // dashboards, alerting rules and quota limits. Therefore, once a metric has + // been published, its type should be immutable. + 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 + // `compute.googleapis.com/instance/network/received_bytes_count` metric type + // has a label, `loadbalanced`, that specifies whether the traffic was + // received through a load balanced IP address. + Labels []*google_api1.LabelDescriptor `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty"` + // Whether the metric records instantaneous values, changes to a value, etc. + 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. + 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) GetLabels() []*google_api1.LabelDescriptor { + if m != nil { + return m.Labels + } + return nil +} + +// 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, `compute.googleapis.com/instance/cpu/usage_time`. + Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` + // The set of labels that uniquely identify a metric. To specify a + // metric, all labels enumerated 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) 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.golang.org/genproto/googleapis/api/metric/metric.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 498 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x52, 0xdf, 0x6b, 0x9b, 0x50, + 0x14, 0x9e, 0x89, 0x71, 0xcd, 0x49, 0x09, 0x72, 0x19, 0x9b, 0xa4, 0x30, 0xb2, 0x3c, 0x74, 0x7d, + 0x4a, 0xa0, 0x1d, 0x65, 0x3f, 0xd8, 0x83, 0xc6, 0xbb, 0x4c, 0x6a, 0x54, 0xac, 0x06, 0xfa, 0x24, + 0x36, 0x11, 0x91, 0x1a, 0x75, 0x6a, 0x0b, 0xf9, 0x2b, 0xf6, 0x17, 0xec, 0x65, 0x7f, 0xe9, 0xee, + 0x0f, 0x9b, 0x48, 0x06, 0x63, 0x2f, 0xe6, 0xbb, 0xdf, 0x39, 0xe7, 0xbb, 0xdf, 0xb9, 0xf9, 0xe0, + 0x6b, 0x9c, 0xe7, 0x71, 0x1a, 0x4d, 0xe3, 0x3c, 0x0d, 0xb3, 0x78, 0x9a, 0x97, 0xf1, 0x2c, 0x8e, + 0xb2, 0xa2, 0xcc, 0xeb, 0x7c, 0xc6, 0x4b, 0x61, 0x91, 0x54, 0x33, 0xf2, 0x99, 0x6d, 0xa3, 0xba, + 0x4c, 0xd6, 0xcd, 0xcf, 0x94, 0xb5, 0x20, 0x68, 0xc6, 0x49, 0x7d, 0xf4, 0xe5, 0xff, 0xa5, 0xd2, + 0xf0, 0x3e, 0x4a, 0xf9, 0x97, 0x0b, 0x4d, 0x7e, 0x89, 0x20, 0x2f, 0x99, 0xb2, 0x1e, 0x55, 0xeb, + 0x32, 0x29, 0xea, 0xbc, 0x44, 0x08, 0xc4, 0x2c, 0xdc, 0x46, 0x8a, 0x30, 0x16, 0x2e, 0xfa, 0x2e, + 0xc3, 0x94, 0xab, 0x77, 0x45, 0xa4, 0x9c, 0x70, 0x8e, 0x62, 0x74, 0x05, 0x12, 0xd3, 0xaa, 0x94, + 0xce, 0xb8, 0x7b, 0x31, 0xb8, 0x3c, 0x9b, 0x1e, 0x6c, 0x4d, 0x4d, 0x5a, 0x39, 0x88, 0xba, 0x4d, + 0x2b, 0xfa, 0x0e, 0x03, 0xbe, 0x4a, 0xf0, 0x90, 0x64, 0x1b, 0xa5, 0x4b, 0xf4, 0x86, 0x97, 0xef, + 0xdb, 0x93, 0xc7, 0x7e, 0x1a, 0xe2, 0x86, 0xb4, 0xbb, 0xb0, 0xdd, 0x63, 0x84, 0x01, 0x9e, 0xc2, + 0xf4, 0x31, 0x0a, 0x98, 0x31, 0x91, 0x09, 0x9d, 0xff, 0x53, 0x68, 0x45, 0xdb, 0x3d, 0xd2, 0xed, + 0xf6, 0x9f, 0x9e, 0x21, 0xdd, 0xec, 0x31, 0x4b, 0x6a, 0xa5, 0xc7, 0x37, 0xa3, 0x18, 0x8d, 0x61, + 0xb0, 0x69, 0xc6, 0x92, 0x3c, 0x53, 0x24, 0x56, 0x6a, 0x53, 0xe8, 0x1d, 0x9c, 0x6e, 0x92, 0xaa, + 0x48, 0xc3, 0x5d, 0xc0, 0xde, 0xea, 0x65, 0xd3, 0xc2, 0x39, 0x8b, 0x50, 0x13, 0x1b, 0xe0, 0xe0, + 0x1c, 0x9d, 0xc1, 0x9b, 0x25, 0xf6, 0x5c, 0x63, 0x1e, 0xdc, 0x18, 0x96, 0x1e, 0xf8, 0xd6, 0xad, + 0x83, 0xe7, 0xc6, 0x37, 0x03, 0xeb, 0xf2, 0x0b, 0xd4, 0x87, 0xde, 0x42, 0xf5, 0x17, 0x58, 0x16, + 0x28, 0xd4, 0xb1, 0xe9, 0xa9, 0x72, 0x07, 0x0d, 0x01, 0xe6, 0xfe, 0xd2, 0x37, 0x55, 0xcf, 0x58, + 0x61, 0xb9, 0x3b, 0xf9, 0x01, 0xfd, 0xfd, 0x06, 0x68, 0x04, 0xaf, 0x57, 0xaa, 0xe9, 0xe3, 0xc0, + 0xbb, 0x73, 0xf0, 0x91, 0xdc, 0x09, 0x88, 0x9a, 0x6d, 0x9b, 0x5c, 0xcd, 0xb0, 0xbc, 0xeb, 0x0f, + 0x44, 0x0d, 0x40, 0xd2, 0x6d, 0x5f, 0x33, 0x89, 0x12, 0xc5, 0xb7, 0xc4, 0x8b, 0xb5, 0x90, 0x45, + 0x24, 0xc3, 0xa9, 0x6e, 0xd0, 0x93, 0xe6, 0x7b, 0x86, 0x6d, 0xc9, 0x3d, 0x3a, 0xb4, 0xb4, 0x2d, + 0x7c, 0x27, 0x4b, 0x93, 0x9f, 0x02, 0x48, 0x7c, 0x89, 0x7d, 0x02, 0xba, 0xad, 0x04, 0x5c, 0x1f, + 0x25, 0xe0, 0xed, 0xdf, 0xcf, 0xcf, 0x83, 0x50, 0xe1, 0xac, 0x2e, 0x77, 0xcf, 0x21, 0x18, 0x7d, + 0x82, 0x41, 0x8b, 0x26, 0x16, 0xba, 0x0f, 0xd1, 0xae, 0xc9, 0x1b, 0x85, 0xe8, 0x15, 0xf4, 0xd8, + 0x3f, 0x44, 0x74, 0x29, 0xc7, 0x0f, 0x9f, 0x3b, 0x1f, 0x05, 0xed, 0x1c, 0x86, 0xeb, 0x7c, 0xdb, + 0xba, 0x47, 0x1b, 0xf0, 0x8b, 0x1c, 0x1a, 0x68, 0x47, 0xf8, 0xdd, 0x11, 0x17, 0xaa, 0x63, 0xdc, + 0x4b, 0x2c, 0xe0, 0x57, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x86, 0xb0, 0x69, 0x6a, 0x03, + 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.proto new file mode 100644 index 0000000000..e896705802 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/metric/metric.proto @@ -0,0 +1,193 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/label/label.proto"; // from google/api/label.proto + +option java_multiple_files = true; +option java_outer_classname = "MetricProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Defines a metric type and its schema. +message MetricDescriptor { + // The kind of measurement. It describes how the data is reported. + enum MetricKind { + // Do not use this default value. + METRIC_KIND_UNSPECIFIED = 0; + + // An instantaneous measurement of a value. + GAUGE = 1; + + // The change in a value during a time interval. + DELTA = 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. + CUMULATIVE = 3; + } + + // The value type of a metric. + enum ValueType { + // Do not use this default value. + VALUE_TYPE_UNSPECIFIED = 0; + + // The value is a boolean. + // This value type can be used only if the metric kind is `GAUGE`. + BOOL = 1; + + // The value is a signed 64-bit integer. + INT64 = 2; + + // The value is a double precision floating point number. + DOUBLE = 3; + + // The value is a text string. + // This value type can be used only if the metric kind is `GAUGE`. + STRING = 4; + + // The value is a [`Distribution`][google.api.Distribution]. + DISTRIBUTION = 5; + + // The value is money. + MONEY = 6; + } + + // Resource name. The format of the name may vary between different + // implementations. For examples: + // + // projects/{project_id}/metricDescriptors/{type=**} + // metricDescriptors/{type=**} + string name = 1; + + // The metric type including a DNS name prefix, for example + // `"compute.googleapis.com/instance/cpu/utilization"`. Metric types + // should use a natural hierarchical grouping such as the following: + // + // compute.googleapis.com/instance/cpu/utilization + // compute.googleapis.com/instance/disk/read_ops_count + // compute.googleapis.com/instance/network/received_bytes_count + // + // Note that if the metric type changes, the monitoring data will be + // discontinued, and anything depends on it will break, such as monitoring + // dashboards, alerting rules and quota limits. Therefore, once a metric has + // been published, its type should be immutable. + string type = 8; + + // The set of labels that can be used to describe a specific instance of this + // metric type. For example, the + // `compute.googleapis.com/instance/network/received_bytes_count` metric type + // has a label, `loadbalanced`, that specifies whether the traffic was + // received through a load balanced IP address. + repeated LabelDescriptor labels = 2; + + // Whether the metric records instantaneous values, changes to a value, etc. + MetricKind metric_kind = 3; + + // Whether the measurement is an integer, a floating-point number, etc. + ValueType value_type = 4; + + // 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 '}'. + string unit = 5; + + // A detailed description of the metric, which can be used in documentation. + string description = 6; + + // A concise name for the metric, which can be displayed in user interfaces. + // Use sentence case without an ending period, for example "Request count". + string display_name = 7; +} + +// A specific metric identified by specifying values for all of the +// labels of a [`MetricDescriptor`][google.api.MetricDescriptor]. +message Metric { + // An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor]. + // For example, `compute.googleapis.com/instance/cpu/usage_time`. + string type = 3; + + // The set of labels that uniquely identify a metric. To specify a + // metric, all labels enumerated in the `MetricDescriptor` must be + // assigned values. + map labels = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go new file mode 100644 index 0000000000..7972e9dcc5 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.pb.go @@ -0,0 +1,148 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto +// DO NOT EDIT! + +/* +Package monitoredres is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto + +It has these top-level messages: + MonitoredResourceDescriptor + MonitoredResource +*/ +package monitoredres // import "google.golang.org/genproto/googleapis/api/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) 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) 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.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xf2, 0x4f, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0xdc, 0xfc, 0xbc, 0xcc, 0x92, 0xfc, 0xa2, 0xd4, 0x94, 0xa2, 0xd4, 0x62, 0x04, 0x27, 0x1e, + 0xc8, 0xcb, 0x2f, 0x2d, 0x4a, 0x4e, 0xd5, 0x03, 0x6b, 0x12, 0xe2, 0x82, 0x1a, 0x08, 0xd4, 0x21, + 0x65, 0x4d, 0xbc, 0xe1, 0x39, 0x89, 0x49, 0xa9, 0x39, 0x10, 0x12, 0x62, 0x90, 0xd2, 0x7e, 0x46, + 0x2e, 0x69, 0x5f, 0x98, 0x2d, 0x41, 0x50, 0x4b, 0x5c, 0x52, 0x8b, 0x93, 0x8b, 0x32, 0x0b, 0x80, + 0x62, 0x42, 0x42, 0x5c, 0x2c, 0x79, 0x89, 0xb9, 0xa9, 0x12, 0xac, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, + 0x60, 0x36, 0x48, 0xac, 0xa4, 0xb2, 0x20, 0x55, 0x82, 0x11, 0x22, 0x06, 0x62, 0x0b, 0x29, 0x72, + 0xf1, 0xa4, 0x64, 0x16, 0x17, 0xe4, 0x24, 0x56, 0xc6, 0x83, 0xd5, 0x33, 0x81, 0xe5, 0xb8, 0xa1, + 0x62, 0x7e, 0x20, 0x6d, 0x0a, 0x5c, 0xdc, 0x29, 0x50, 0x83, 0x33, 0xf3, 0xf3, 0x24, 0x98, 0xa1, + 0x2a, 0x10, 0x42, 0x42, 0xc6, 0x5c, 0x6c, 0x60, 0xb7, 0x15, 0x4b, 0xb0, 0x28, 0x30, 0x6b, 0x70, + 0x1b, 0x49, 0xeb, 0x21, 0xbc, 0xa9, 0xe7, 0x03, 0x92, 0x41, 0xb8, 0x2c, 0x08, 0xaa, 0x54, 0x69, + 0x29, 0x23, 0x97, 0x20, 0x86, 0x0f, 0xb0, 0xba, 0xd1, 0x11, 0x6e, 0x3c, 0x13, 0xd8, 0x78, 0x4d, + 0x64, 0xe3, 0x31, 0x8c, 0x80, 0x58, 0x58, 0xec, 0x9a, 0x57, 0x52, 0x54, 0x09, 0xb3, 0x4c, 0xca, + 0x92, 0x8b, 0x1b, 0x49, 0x58, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x12, 0x6a, 0x09, 0x88, 0x29, + 0x24, 0xc2, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x0a, 0x0b, 0x00, 0x08, 0xc7, 0x8a, 0xc9, 0x82, 0xd1, + 0x29, 0x87, 0x8b, 0x2f, 0x39, 0x3f, 0x17, 0xc9, 0x4a, 0x27, 0x31, 0x0c, 0x3b, 0x03, 0x40, 0x71, + 0x12, 0xc0, 0x18, 0x65, 0x46, 0x5e, 0x7a, 0xf9, 0xc1, 0xc8, 0xb8, 0x88, 0x89, 0xc5, 0xdd, 0x31, + 0xc0, 0x33, 0x89, 0x0d, 0xac, 0xd8, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x87, 0xa2, 0x37, + 0x7a, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto new file mode 100644 index 0000000000..e01b62144e --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto @@ -0,0 +1,91 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/label/label.proto"; // from google/api/label.proto + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_outer_classname = "MonitoredResourceProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +option go_package = "google.golang.org/genproto/googleapis/api/monitoredres"; + +// 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. +message MonitoredResourceDescriptor { + // 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}"`. + string name = 5; + + // 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. + string type = 1; + + // 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"`. + string display_name = 2; + + // Optional. A detailed description of the monitored resource type that might + // be used in documentation. + string description = 3; + + // 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"`. + repeated LabelDescriptor labels = 4; +} + +// 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" }} +message MonitoredResource { + // 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"`. + string type = 1; + + // 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"`. + map labels = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.pb.go new file mode 100644 index 0000000000..2a8ea098b0 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.pb.go @@ -0,0 +1,108 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto +// DO NOT EDIT! + +/* +Package google_api is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto + google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto + google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto + google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto + google.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto + google.golang.org/genproto/googleapis/api/serviceconfig/context.proto + google.golang.org/genproto/googleapis/api/serviceconfig/control.proto + google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto + google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto + google.golang.org/genproto/googleapis/api/serviceconfig/http.proto + google.golang.org/genproto/googleapis/api/serviceconfig/log.proto + google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto + google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto + google.golang.org/genproto/googleapis/api/serviceconfig/service.proto + google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto + google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto + +It has these top-level messages: + Authentication + AuthenticationRule + AuthProvider + OAuthRequirements + AuthRequirement + Backend + BackendRule + Billing + BillingStatusRule + ProjectProperties + Property + Context + ContextRule + Control + Documentation + DocumentationRule + Page + Endpoint + Http + HttpRule + CustomHttpPattern + LogDescriptor + Logging + Monitoring + Service + SystemParameters + SystemParameterRule + SystemParameter + Usage + UsageRule +*/ +package google_api // import "google.golang.org/genproto/googleapis/api/serviceconfig" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_protobuf "google.golang.org/genproto/protobuf" + +// 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", +} + +func init() { + proto.RegisterExtension(E_Http) +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 211 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xf2, 0x4c, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0xe2, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0xd4, 0xe4, 0xfc, 0xbc, 0xb4, 0xcc, 0x74, 0xfd, 0xc4, + 0xbc, 0xbc, 0xfc, 0x92, 0xc4, 0x92, 0xcc, 0xfc, 0xbc, 0x62, 0x3d, 0xb0, 0x72, 0x21, 0x2e, 0xa8, + 0x51, 0x40, 0xb5, 0x52, 0x4e, 0xe4, 0x1a, 0x9b, 0x51, 0x52, 0x52, 0x00, 0x31, 0x4f, 0xca, 0x04, + 0x8f, 0x19, 0x60, 0x32, 0xa9, 0x34, 0x4d, 0x3f, 0x25, 0xb5, 0x38, 0xb9, 0x28, 0xb3, 0xa0, 0x24, + 0xbf, 0x08, 0xa2, 0xcb, 0xca, 0x9b, 0x8b, 0x05, 0x64, 0x86, 0x90, 0x9c, 0x1e, 0x54, 0x3b, 0x4c, + 0xa9, 0x9e, 0x6f, 0x6a, 0x49, 0x46, 0x7e, 0x8a, 0x7f, 0x01, 0xd8, 0xcd, 0x12, 0x1b, 0x4e, 0xed, + 0x51, 0x52, 0x60, 0xd4, 0xe0, 0x36, 0x12, 0xd1, 0x43, 0xb8, 0x5b, 0xcf, 0x03, 0xa8, 0x35, 0xa8, + 0x34, 0x27, 0x35, 0x08, 0x6c, 0x88, 0x93, 0x36, 0x17, 0x5f, 0x72, 0x7e, 0x2e, 0x92, 0x02, 0x27, + 0x01, 0x47, 0x84, 0xbf, 0x03, 0x40, 0x26, 0x07, 0x30, 0x2e, 0x62, 0x62, 0x71, 0x77, 0x0c, 0xf0, + 0x4c, 0x62, 0x03, 0xdb, 0x64, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x01, 0xd8, 0x8e, 0xc1, 0x53, + 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto new file mode 100644 index 0000000000..306bc405a2 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto @@ -0,0 +1,30 @@ +// Copyright (c) 2015, 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/http.proto"; // from google/api/http.proto +import "google.golang.org/genproto/protobuf/descriptor.proto"; // from google/protobuf/descriptor.proto + +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go new file mode 100644 index 0000000000..7bc7148f3a --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.pb.go @@ -0,0 +1,242 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// `Authentication` defines the authentication configuration for an API. +// +// Example for an API targeted for external use: +// +// name: calendar.googleapis.com +// authentication: +// rules: +// - selector: "*" +// oauth: +// canonical_scopes: https://www.googleapis.com/auth/calendar +// +// - selector: google.calendar.Delegate +// oauth: +// canonical_scopes: https://www.googleapis.com/auth/calendar.read +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 fileDescriptor1, []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 fileDescriptor1, []int{1} } + +func (m *AuthenticationRule) GetOauth() *OAuthRequirements { + if m != nil { + return m.Oauth + } + return nil +} + +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"` +} + +func (m *AuthProvider) Reset() { *m = AuthProvider{} } +func (m *AuthProvider) String() string { return proto.CompactTextString(m) } +func (*AuthProvider) ProtoMessage() {} +func (*AuthProvider) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +// 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 fileDescriptor1, []int{3} } + +// 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"` + // 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 fileDescriptor1, []int{4} } + +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.golang.org/genproto/googleapis/api/serviceconfig/auth.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 425 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x52, 0x4d, 0x6f, 0x13, 0x31, + 0x10, 0x55, 0xd2, 0xa6, 0xcd, 0x4e, 0xaa, 0x14, 0x7c, 0xa8, 0x4c, 0xf9, 0xaa, 0x56, 0x1c, 0xca, + 0x65, 0x57, 0x6a, 0x11, 0xe2, 0x04, 0x6a, 0x38, 0xa0, 0x9c, 0x08, 0x46, 0x88, 0xe3, 0xca, 0x78, + 0xcd, 0xd6, 0xe0, 0x7a, 0x82, 0xed, 0x6d, 0x6e, 0xfc, 0x18, 0x7e, 0x19, 0x3f, 0x05, 0xaf, 0x77, + 0x9b, 0x6c, 0x93, 0x1b, 0x97, 0x28, 0x33, 0xef, 0xcd, 0x7b, 0x7e, 0x33, 0x0b, 0xb3, 0x0a, 0xb1, + 0xd2, 0x32, 0xab, 0x50, 0x73, 0x53, 0x65, 0x68, 0xab, 0xbc, 0x92, 0x66, 0x69, 0xd1, 0x63, 0xde, + 0x42, 0x7c, 0xa9, 0x5c, 0x1e, 0x7e, 0x72, 0x27, 0xed, 0xad, 0x12, 0x52, 0xa0, 0xf9, 0xae, 0xaa, + 0x9c, 0xd7, 0xfe, 0x3a, 0x8b, 0x3c, 0x02, 0x9d, 0x46, 0x20, 0x9d, 0xce, 0xff, 0x5b, 0xcf, 0x18, + 0xf4, 0xdc, 0x2b, 0x34, 0xae, 0x95, 0x4d, 0x7f, 0xc3, 0xf4, 0x2a, 0x98, 0x48, 0xe3, 0x95, 0x88, + 0x00, 0x79, 0x05, 0x23, 0x5b, 0x6b, 0xe9, 0xe8, 0xde, 0xd9, 0xde, 0xf9, 0xe4, 0xe2, 0x59, 0xb6, + 0x31, 0xce, 0xee, 0x53, 0x59, 0xa0, 0xb1, 0x96, 0x4c, 0x5e, 0x43, 0x12, 0x04, 0x6f, 0x55, 0x29, + 0xad, 0xa3, 0xfb, 0x71, 0x92, 0x6e, 0x4f, 0x2e, 0x3a, 0x02, 0xdb, 0x50, 0xd3, 0xbf, 0x03, 0x20, + 0xbb, 0xaa, 0xe4, 0x14, 0xc6, 0x4e, 0x6a, 0x29, 0x3c, 0x5a, 0x3a, 0x38, 0x1b, 0x9c, 0x27, 0x6c, + 0x5d, 0x93, 0x4b, 0x18, 0x61, 0xb3, 0x18, 0x3a, 0x0c, 0xc0, 0xe4, 0xe2, 0x69, 0xdf, 0xe6, 0x63, + 0xa3, 0xc5, 0xe4, 0xaf, 0x5a, 0x59, 0x79, 0x13, 0x34, 0x1d, 0x6b, 0xb9, 0xe4, 0x0d, 0x50, 0xae, + 0x35, 0xae, 0x8a, 0x95, 0xf2, 0xd7, 0x58, 0xfb, 0x42, 0x58, 0x59, 0x36, 0xa6, 0x5c, 0xd3, 0x51, + 0xd0, 0x19, 0xb3, 0x93, 0x88, 0x7f, 0x6d, 0xe1, 0xf7, 0x6b, 0x94, 0xbc, 0x83, 0x23, 0xdb, 0x13, + 0xa4, 0x87, 0x31, 0xdc, 0xe3, 0xed, 0x70, 0x3d, 0x53, 0x76, 0x6f, 0x20, 0xfd, 0x04, 0x47, 0xfd, + 0xf4, 0x64, 0x0a, 0x43, 0x55, 0x76, 0xa9, 0xc2, 0x3f, 0x72, 0x02, 0x07, 0xca, 0xb9, 0x5a, 0xda, + 0x18, 0x28, 0x61, 0x5d, 0x45, 0x1e, 0xc1, 0xf8, 0xc7, 0xea, 0xa7, 0x2b, 0x6a, 0xab, 0xc2, 0x2d, + 0x1a, 0xe4, 0xb0, 0xa9, 0xbf, 0x58, 0x95, 0xbe, 0x85, 0x87, 0x3b, 0x49, 0xc9, 0x4b, 0x78, 0x20, + 0xb8, 0x41, 0x13, 0xf6, 0xa8, 0x0b, 0x27, 0x70, 0x19, 0x6e, 0xd8, 0xba, 0x1c, 0xaf, 0xfb, 0x9f, + 0x63, 0x3b, 0x5d, 0xc0, 0xf1, 0xd6, 0x38, 0x79, 0x0e, 0x93, 0xbb, 0xab, 0x14, 0xeb, 0xe7, 0xc1, + 0x5d, 0x6b, 0x5e, 0x92, 0x27, 0x90, 0xf0, 0xba, 0x54, 0xd2, 0x88, 0xa0, 0xdb, 0xbe, 0x74, 0xd3, + 0x98, 0xbd, 0x80, 0xa9, 0xc0, 0x9b, 0xde, 0x52, 0x66, 0x49, 0x17, 0xda, 0xe3, 0x62, 0xf0, 0x67, + 0xb8, 0xff, 0xe1, 0x6a, 0x31, 0xff, 0x76, 0x10, 0x3f, 0xba, 0xcb, 0x7f, 0x01, 0x00, 0x00, 0xff, + 0xff, 0x0d, 0x41, 0xfd, 0x7a, 0x11, 0x03, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto new file mode 100644 index 0000000000..8193b36e16 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto @@ -0,0 +1,164 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "AuthProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `Authentication` defines the authentication configuration for an API. +// +// Example for an API targeted for external use: +// +// name: calendar.googleapis.com +// authentication: +// rules: +// - selector: "*" +// oauth: +// canonical_scopes: https://www.googleapis.com/auth/calendar +// +// - selector: google.calendar.Delegate +// oauth: +// canonical_scopes: https://www.googleapis.com/auth/calendar.read +message Authentication { + // A list of authentication rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated AuthenticationRule rules = 3; + + // Defines a set of authentication providers that a service supports. + repeated AuthProvider providers = 4; +} + +// 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. +message AuthenticationRule { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // The requirements for OAuth credentials. + OAuthRequirements oauth = 2; + + // 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. + bool allow_without_credential = 5; + + // Requirements for additional authentication providers. + repeated AuthRequirement requirements = 7; +} + +// Configuration for an anthentication provider, including support for +// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +message AuthProvider { + // The unique identifier of the auth provider. It will be referred to by + // `AuthRequirement.provider_id`. + // + // Example: "bookstore_auth". + string id = 1; + + // 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 + string issuer = 2; + + // 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 + string jwks_uri = 3; +} + +// 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. +message OAuthRequirements { + // 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 + string canonical_scopes = 1; +} + +// User-defined authentication requirements, including support for +// [JSON Web Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). +message AuthRequirement { + // [id][google.api.AuthProvider.id] from authentication provider. + // + // Example: + // + // provider_id: bookstore_auth + string provider_id = 1; + + // 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 + string audiences = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go new file mode 100644 index 0000000000..d84a9058ea --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.pb.go @@ -0,0 +1,79 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 fileDescriptor2, []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 fileDescriptor2, []int{1} } + +func init() { + proto.RegisterType((*Backend)(nil), "google.api.Backend") + proto.RegisterType((*BackendRule)(nil), "google.api.BackendRule") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 217 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0x8f, 0xcf, 0x4e, 0x03, 0x21, + 0x10, 0xc6, 0x43, 0xab, 0x56, 0xa7, 0xc6, 0x03, 0x17, 0x89, 0x27, 0xd3, 0x8b, 0xbd, 0x08, 0x89, + 0x5e, 0xbc, 0xba, 0x89, 0x31, 0xde, 0x36, 0xbc, 0x80, 0xa1, 0x30, 0x12, 0x22, 0x32, 0x0d, 0x54, + 0x1f, 0xc8, 0x27, 0x95, 0xfd, 0xe3, 0x76, 0x2f, 0x24, 0x1f, 0xbf, 0x1f, 0xc3, 0x7c, 0xf0, 0xe2, + 0x89, 0x7c, 0x44, 0xe9, 0x29, 0x9a, 0xe4, 0x25, 0x65, 0xaf, 0x3c, 0xa6, 0x7d, 0xa6, 0x03, 0xa9, + 0x01, 0x99, 0x7d, 0x28, 0xaa, 0x1e, 0xaa, 0x60, 0xfe, 0x09, 0x16, 0x2d, 0xa5, 0x8f, 0xe0, 0xd5, + 0xce, 0xd8, 0x4f, 0x4c, 0x4e, 0xf6, 0x2a, 0x87, 0x71, 0x4c, 0xf5, 0x36, 0x4f, 0xb0, 0x6a, 0x06, + 0xc8, 0xef, 0xe1, 0x34, 0x7f, 0x47, 0x2c, 0x82, 0xdd, 0x2e, 0xb7, 0xeb, 0x87, 0x6b, 0x79, 0xd4, + 0xe4, 0xe8, 0xe8, 0xca, 0xf5, 0x60, 0x6d, 0xde, 0x61, 0x3d, 0xbb, 0xe5, 0x37, 0x70, 0x5e, 0x30, + 0xa2, 0x3d, 0x50, 0xae, 0x03, 0xd8, 0xf6, 0x42, 0x4f, 0x99, 0x0b, 0x58, 0x19, 0xe7, 0x32, 0x96, + 0x22, 0x16, 0x3d, 0xfa, 0x8f, 0xdd, 0x2b, 0x87, 0xc6, 0xc5, 0x90, 0x50, 0x2c, 0x2b, 0x62, 0x7a, + 0xca, 0xcd, 0x1d, 0x5c, 0x59, 0xfa, 0x9a, 0x6d, 0xd1, 0x5c, 0x8e, 0x1f, 0xb6, 0x5d, 0x8d, 0x96, + 0xfd, 0x2e, 0x4e, 0x5e, 0x9f, 0xdb, 0xb7, 0xdd, 0x59, 0x5f, 0xeb, 0xf1, 0x2f, 0x00, 0x00, 0xff, + 0xff, 0x1b, 0xf2, 0x31, 0x3a, 0x1f, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto new file mode 100644 index 0000000000..3c12c8c366 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto @@ -0,0 +1,46 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "BackendProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `Backend` defines the backend configuration for a service. +message Backend { + // A list of API backend rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated BackendRule rules = 1; +} + +// A backend rule provides configuration for an individual API element. +message BackendRule { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // The address of the API backend. + string address = 2; + + // The number of seconds to wait for a response from a request. The + // default depends on the deployment context. + double deadline = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go new file mode 100644 index 0000000000..14e5b47080 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.pb.go @@ -0,0 +1,131 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/serviceconfig" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +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 metrics for billing: +// +// metrics: +// - name: library.googleapis.com/read_calls +// metric_kind: DELTA +// value_type: INT64 +// - name: library.googleapis.com/write_calls +// metric_kind: DELTA +// value_type: INT64 +// billing: +// metrics: +// - library.googleapis.com/read_calls +// - library.googleapis.com/write_calls +// +// The next example shows how to enable billing status check and customize the +// check behavior. It makes sure billing status check is included in the `Check` +// method of [Service Control API](https://cloud.google.com/service-control/). +// In the example, "google.storage.Get" method can be served when the billing +// status is either `current` or `delinquent`, while "google.storage.Write" +// method can only be served when the billing status is `current`: +// +// billing: +// rules: +// - selector: google.storage.Get +// allowed_statuses: +// - current +// - delinquent +// - selector: google.storage.Write +// allowed_statuses: current +// +// Mostly services should only allow `current` status when serving requests. +// In addition, services can choose to allow both `current` and `delinquent` +// statuses when serving read-only requests to resources. If there's no +// matching selector for operation, no billing status check will be performed. +// +type Billing struct { + // Names of the metrics to report to billing. Each name must + // be defined in [Service.metrics][google.api.Service.metrics] section. + Metrics []string `protobuf:"bytes,1,rep,name=metrics" json:"metrics,omitempty"` + // A list of billing status rules for configuring billing status check. + Rules []*BillingStatusRule `protobuf:"bytes,5,rep,name=rules" json:"rules,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 fileDescriptor3, []int{0} } + +func (m *Billing) GetRules() []*BillingStatusRule { + if m != nil { + return m.Rules + } + return nil +} + +// Defines the billing status requirements for operations. +// +// When used with +// [Service Control API](https://cloud.google.com/service-control/), the +// following statuses are supported: +// +// - **current**: the associated billing account is up to date and capable of +// paying for resource usages. +// - **delinquent**: the associated billing account has a correctable problem, +// such as late payment. +// +// Mostly services should only allow `current` status when serving requests. +// In addition, services can choose to allow both `current` and `delinquent` +// statuses when serving read-only requests to resources. If the list of +// allowed_statuses is empty, it means no billing requirement. +// +type BillingStatusRule struct { + // Selects the operation names 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"` + // Allowed billing statuses. The billing status check passes if the actual + // billing status matches any of the provided values here. + AllowedStatuses []string `protobuf:"bytes,2,rep,name=allowed_statuses,json=allowedStatuses" json:"allowed_statuses,omitempty"` +} + +func (m *BillingStatusRule) Reset() { *m = BillingStatusRule{} } +func (m *BillingStatusRule) String() string { return proto.CompactTextString(m) } +func (*BillingStatusRule) ProtoMessage() {} +func (*BillingStatusRule) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } + +func init() { + proto.RegisterType((*Billing)(nil), "google.api.Billing") + proto.RegisterType((*BillingStatusRule)(nil), "google.api.BillingStatusRule") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto", fileDescriptor3) +} + +var fileDescriptor3 = []byte{ + // 245 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x4f, 0xbd, 0x4b, 0x43, 0x31, + 0x10, 0xe7, 0x29, 0xb5, 0x7a, 0x8a, 0x1f, 0x99, 0x1e, 0x0f, 0x84, 0xd2, 0x49, 0x97, 0x17, 0xb0, + 0xb3, 0xcb, 0x03, 0x07, 0xb7, 0xf2, 0xba, 0x88, 0x8b, 0xa4, 0xf1, 0x0c, 0x81, 0x34, 0x57, 0x92, + 0x54, 0xff, 0x7d, 0xcf, 0x24, 0x7e, 0x80, 0x8b, 0xb8, 0x24, 0xdc, 0xdd, 0xef, 0x13, 0xee, 0x0c, + 0x91, 0x71, 0xd8, 0x1b, 0x72, 0xca, 0x9b, 0x9e, 0x82, 0x91, 0x06, 0xfd, 0x36, 0x50, 0x22, 0x59, + 0x4e, 0x6a, 0x6b, 0xa3, 0xe4, 0x47, 0x46, 0x0c, 0xaf, 0x56, 0xa3, 0x26, 0xff, 0x62, 0x8d, 0x5c, + 0x5b, 0xe7, 0x2c, 0x33, 0x32, 0x54, 0x40, 0x95, 0x61, 0x5c, 0x77, 0xff, 0x5f, 0x49, 0xe5, 0x3d, + 0x25, 0x95, 0x2c, 0xf9, 0x58, 0x64, 0xbb, 0xdb, 0xbf, 0x4b, 0x6d, 0x30, 0x05, 0xab, 0xeb, 0x57, + 0xe8, 0xf3, 0x07, 0x98, 0x0e, 0x25, 0xa6, 0x68, 0x61, 0x5a, 0x4e, 0xb1, 0x6d, 0x66, 0xfb, 0x57, + 0x47, 0xe3, 0xe7, 0x28, 0x16, 0x30, 0x09, 0x3b, 0x87, 0xb1, 0x9d, 0xf0, 0xfe, 0xf8, 0xe6, 0xb2, + 0xff, 0xae, 0xd2, 0x57, 0xf6, 0x8a, 0x53, 0xed, 0xe2, 0xc8, 0xa8, 0xb1, 0x60, 0xe7, 0x8f, 0x70, + 0xf1, 0xeb, 0x26, 0x3a, 0x38, 0x8c, 0xe8, 0x50, 0x27, 0x0a, 0x6c, 0xd2, 0xb0, 0xc9, 0xd7, 0x2c, + 0xae, 0xe1, 0x5c, 0x39, 0x47, 0x6f, 0xf8, 0xfc, 0x14, 0x33, 0x83, 0x0d, 0xf7, 0x72, 0x90, 0xb3, + 0xba, 0x5f, 0xd5, 0xf5, 0x30, 0x83, 0x53, 0x4d, 0x9b, 0x1f, 0x31, 0x86, 0x93, 0xea, 0xb5, 0xfc, + 0x68, 0xb5, 0x6c, 0xd6, 0x07, 0xb9, 0xde, 0xe2, 0x3d, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xe1, 0x19, + 0xb1, 0xbd, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto new file mode 100644 index 0000000000..f6867205b7 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/billing.proto @@ -0,0 +1,97 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "google.golang.org/genproto/googleapis/api/metric/metric.proto"; // from google/api/metric.proto + +option java_multiple_files = true; +option java_outer_classname = "BillingProto"; +option java_package = "com.google.api"; + + +// Billing related configuration of the service. +// +// The following example shows how to configure metrics for billing: +// +// metrics: +// - name: library.googleapis.com/read_calls +// metric_kind: DELTA +// value_type: INT64 +// - name: library.googleapis.com/write_calls +// metric_kind: DELTA +// value_type: INT64 +// billing: +// metrics: +// - library.googleapis.com/read_calls +// - library.googleapis.com/write_calls +// +// The next example shows how to enable billing status check and customize the +// check behavior. It makes sure billing status check is included in the `Check` +// method of [Service Control API](https://cloud.google.com/service-control/). +// In the example, "google.storage.Get" method can be served when the billing +// status is either `current` or `delinquent`, while "google.storage.Write" +// method can only be served when the billing status is `current`: +// +// billing: +// rules: +// - selector: google.storage.Get +// allowed_statuses: +// - current +// - delinquent +// - selector: google.storage.Write +// allowed_statuses: current +// +// Mostly services should only allow `current` status when serving requests. +// In addition, services can choose to allow both `current` and `delinquent` +// statuses when serving read-only requests to resources. If there's no +// matching selector for operation, no billing status check will be performed. +// +message Billing { + // Names of the metrics to report to billing. Each name must + // be defined in [Service.metrics][google.api.Service.metrics] section. + repeated string metrics = 1; + + // A list of billing status rules for configuring billing status check. + repeated BillingStatusRule rules = 5; +} + +// Defines the billing status requirements for operations. +// +// When used with +// [Service Control API](https://cloud.google.com/service-control/), the +// following statuses are supported: +// +// - **current**: the associated billing account is up to date and capable of +// paying for resource usages. +// - **delinquent**: the associated billing account has a correctable problem, +// such as late payment. +// +// Mostly services should only allow `current` status when serving requests. +// In addition, services can choose to allow both `current` and `delinquent` +// statuses when serving read-only requests to resources. If the list of +// allowed_statuses is empty, it means no billing requirement. +// +message BillingStatusRule { + // Selects the operation names to which this rule applies. + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Allowed billing statuses. The billing status check passes if the actual + // billing status matches any of the provided values here. + repeated string allowed_statuses = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go new file mode 100644 index 0000000000..c3758be29e --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.pb.go @@ -0,0 +1,139 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 fileDescriptor4, []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 fileDescriptor4, []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 fileDescriptor4, []int{1} } + +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.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto", fileDescriptor4) +} + +var fileDescriptor4 = []byte{ + // 287 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4e, 0xb3, 0x40, + 0x14, 0x85, 0x7f, 0x0a, 0x7f, 0xd3, 0x5e, 0xb4, 0xe2, 0xc4, 0x05, 0xcb, 0x96, 0x55, 0x57, 0x90, + 0xd4, 0xea, 0x03, 0xd0, 0x52, 0x43, 0x42, 0x80, 0x50, 0xfa, 0x00, 0x88, 0xd7, 0xc9, 0x98, 0xc2, + 0x4c, 0x06, 0x34, 0xe9, 0x03, 0xfa, 0x5e, 0x4e, 0x11, 0x2b, 0x0b, 0x37, 0xdc, 0xc3, 0xbd, 0xdf, + 0x39, 0x99, 0x1c, 0xd8, 0x51, 0xce, 0xe9, 0x11, 0x5d, 0xca, 0x8f, 0x45, 0x4d, 0x5d, 0x2e, 0xa9, + 0x47, 0xb1, 0x16, 0x92, 0xb7, 0xdc, 0xfb, 0x3e, 0x15, 0x82, 0x35, 0x9e, 0xfa, 0x78, 0x0d, 0xca, + 0x0f, 0x56, 0x62, 0xc9, 0xeb, 0x57, 0x46, 0x3d, 0x35, 0x9a, 0xf7, 0x0a, 0xa5, 0xdb, 0xb1, 0x04, + 0xfa, 0x1c, 0x05, 0x3a, 0x21, 0xdc, 0xa6, 0x92, 0xbf, 0x61, 0xd9, 0xaa, 0x21, 0x50, 0xb6, 0x0c, + 0x1b, 0xb2, 0x06, 0x10, 0x97, 0x3f, 0x5b, 0x9b, 0xeb, 0x4b, 0x73, 0x75, 0xe7, 0xfe, 0xba, 0xdc, + 0x9e, 0x3d, 0x65, 0x03, 0xce, 0xf9, 0xd4, 0x60, 0xf2, 0x73, 0x20, 0x04, 0x8c, 0xba, 0xa8, 0x50, + 0x99, 0xb5, 0xe5, 0x34, 0xeb, 0x34, 0x79, 0x00, 0xa3, 0x3d, 0x09, 0xb4, 0x47, 0x6a, 0x37, 0x5b, + 0x2d, 0xfe, 0x0a, 0xbc, 0x88, 0x5c, 0x81, 0x59, 0x87, 0x93, 0x39, 0x98, 0x2f, 0xd8, 0x94, 0x92, + 0x89, 0x96, 0xf1, 0xda, 0xd6, 0xbb, 0xc4, 0xe1, 0xca, 0x89, 0xe0, 0x6a, 0xe8, 0x23, 0x37, 0x60, + 0x1e, 0xe2, 0x7d, 0x1a, 0x6c, 0xc2, 0x5d, 0x18, 0x6c, 0xad, 0x7f, 0x64, 0x0a, 0xff, 0xc3, 0x38, + 0x7f, 0x5c, 0x5b, 0x1a, 0x99, 0x80, 0xe1, 0x27, 0x49, 0x64, 0x8d, 0x08, 0xc0, 0x78, 0x9f, 0x67, + 0x61, 0xfc, 0x64, 0xe9, 0x67, 0xbd, 0x4d, 0x0e, 0x7e, 0x14, 0x58, 0x86, 0xbf, 0x80, 0x59, 0xc9, + 0xab, 0xc1, 0xeb, 0xfc, 0xeb, 0x4d, 0x5f, 0x60, 0x7a, 0xee, 0x2f, 0xd5, 0x9e, 0xc7, 0x5d, 0x91, + 0xf7, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0xba, 0x74, 0x16, 0x92, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto new file mode 100644 index 0000000000..88879348b7 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/consumer.proto @@ -0,0 +1,82 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "ConsumerProto"; +option java_package = "com.google.api"; + + +// 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 +message ProjectProperties { + // List of per consumer project-specific properties. + repeated Property properties = 1; +} + +// 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. +message Property { + // Supported data type of the property values + enum PropertyType { + // The type is unspecified, and will result in an error. + UNSPECIFIED = 0; + + // The type is `int64`. + INT64 = 1; + + // The type is `bool`. + BOOL = 2; + + // The type is `string`. + STRING = 3; + + // The type is 'double'. + DOUBLE = 4; + } + + // The name of the property (a.k.a key). + string name = 1; + + // The type of this property. + PropertyType type = 2; + + // The description of the property + string description = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go new file mode 100644 index 0000000000..778a61d6c2 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.pb.go @@ -0,0 +1,95 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/context.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 fileDescriptor5, []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 fileDescriptor5, []int{1} } + +func init() { + proto.RegisterType((*Context)(nil), "google.api.Context") + proto.RegisterType((*ContextRule)(nil), "google.api.ContextRule") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/context.proto", fileDescriptor5) +} + +var fileDescriptor5 = []byte{ + // 219 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x72, 0x4d, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0xe2, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0xd4, 0xe4, 0xfc, 0xbc, 0xb4, 0xcc, 0x74, 0x7d, 0x20, + 0x55, 0x92, 0x5a, 0x51, 0xa2, 0x07, 0x56, 0x2a, 0xc4, 0x05, 0x35, 0x06, 0xa8, 0x4e, 0xc9, 0x82, + 0x8b, 0xdd, 0x19, 0x22, 0x29, 0xa4, 0xcb, 0xc5, 0x5a, 0x54, 0x9a, 0x93, 0x5a, 0x2c, 0xc1, 0xa8, + 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0x50, 0xa6, 0x07, 0x55, 0x13, 0x04, 0x94, 0x0f, 0x82, + 0xa8, 0x52, 0x4a, 0xe6, 0xe2, 0x46, 0x12, 0x15, 0x92, 0xe2, 0xe2, 0x28, 0x4e, 0xcd, 0x49, 0x4d, + 0x2e, 0xc9, 0x2f, 0x02, 0x1a, 0xc0, 0xa8, 0xc1, 0x19, 0x04, 0xe7, 0x0b, 0xc9, 0x70, 0x71, 0x16, + 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0xa4, 0xa6, 0x48, 0x30, 0x01, 0x4d, 0xe7, 0x0c, 0x42, 0x08, + 0x80, 0x74, 0x02, 0xdd, 0x55, 0x96, 0x99, 0x02, 0x94, 0x64, 0x06, 0x4b, 0xc2, 0xf9, 0x4e, 0xea, + 0x5c, 0x7c, 0xc9, 0xf9, 0xb9, 0x48, 0x2e, 0x71, 0xe2, 0x81, 0x5a, 0x1a, 0x00, 0xf2, 0x4a, 0x00, + 0xe3, 0x22, 0x26, 0x16, 0x77, 0xc7, 0x00, 0xcf, 0x24, 0x36, 0xb0, 0xd7, 0x8c, 0x01, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xe7, 0x43, 0x17, 0x5f, 0x23, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.proto new file mode 100644 index 0000000000..427524f607 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/context.proto @@ -0,0 +1,62 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "ContextProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `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`. +message Context { + // A list of RPC context rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated ContextRule rules = 1; +} + +// A context rule provides information about the context for an individual API +// element. +message ContextRule { + // Selects the methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // A list of full type names of requested contexts. + repeated string requested = 2; + + // A list of full type names of provided contexts. + repeated string provided = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go new file mode 100644 index 0000000000..ad28c8e417 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.pb.go @@ -0,0 +1,50 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/control.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 fileDescriptor6, []int{0} } + +func init() { + proto.RegisterType((*Control)(nil), "google.api.Control") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/control.proto", fileDescriptor6) +} + +var fileDescriptor6 = []byte{ + // 154 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x72, 0x4d, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0xe2, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0xd4, 0xe4, 0xfc, 0xbc, 0xb4, 0xcc, 0x74, 0x7d, 0x20, + 0x55, 0x52, 0x94, 0x9f, 0xa3, 0x07, 0x56, 0x2a, 0xc4, 0x05, 0x35, 0x06, 0xa8, 0x4e, 0x49, 0x9b, + 0x8b, 0xdd, 0x19, 0x22, 0x29, 0xa4, 0xc0, 0xc5, 0x9d, 0x9a, 0x57, 0x96, 0x59, 0x94, 0x9f, 0x97, + 0x9b, 0x9a, 0x57, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x19, 0x84, 0x2c, 0xe4, 0xa4, 0xce, 0xc5, + 0x97, 0x9c, 0x9f, 0xab, 0x87, 0xd0, 0xee, 0xc4, 0x03, 0xd5, 0x1c, 0x00, 0x32, 0x38, 0x80, 0x71, + 0x11, 0x13, 0x8b, 0xbb, 0x63, 0x80, 0x67, 0x12, 0x1b, 0xd8, 0x22, 0x63, 0x40, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x77, 0x67, 0xbb, 0x6f, 0xb1, 0x00, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.proto new file mode 100644 index 0000000000..d99b2b084b --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/control.proto @@ -0,0 +1,32 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "ControlProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Selects and configures the service controller used by the service. The +// service controller handles features like abuse, quota, billing, logging, +// monitoring, etc. +message Control { + // The service control environment to use. If empty, no control plane + // feature (like quota and billing) will be enabled. + string environment = 1; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go new file mode 100644 index 0000000000..21612de178 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.pb.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 fileDescriptor7, []int{0} } + +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 +} + +// 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 fileDescriptor7, []int{1} } + +// 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 fileDescriptor7, []int{2} } + +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.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto", fileDescriptor7) +} + +var fileDescriptor7 = []byte{ + // 342 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x4a, 0xc3, 0x40, + 0x10, 0xc6, 0x49, 0x93, 0xfa, 0x67, 0x8a, 0xa2, 0x8b, 0xd4, 0x20, 0x08, 0xa5, 0x07, 0xe9, 0x41, + 0x13, 0xb0, 0x82, 0x67, 0x4b, 0x41, 0xc4, 0x4b, 0x08, 0x78, 0x2e, 0xe9, 0x76, 0x5c, 0x02, 0x49, + 0x26, 0x6c, 0x92, 0x8a, 0xaf, 0xe0, 0x63, 0xf8, 0x54, 0x3e, 0x8e, 0x9b, 0x4d, 0x9a, 0x6e, 0x10, + 0x2f, 0x21, 0x93, 0xef, 0xb7, 0x33, 0xdf, 0x7c, 0x1b, 0x78, 0x15, 0x44, 0x22, 0x41, 0x4f, 0x50, + 0x12, 0x65, 0xc2, 0x23, 0x29, 0x7c, 0x81, 0x59, 0x2e, 0xa9, 0x24, 0xbf, 0x91, 0xa2, 0x3c, 0x2e, + 0x7c, 0xf5, 0xf0, 0x0b, 0x94, 0xdb, 0x98, 0x23, 0xa7, 0xec, 0x3d, 0x16, 0xfe, 0x86, 0x78, 0x95, + 0x62, 0x56, 0x46, 0x65, 0x4c, 0x99, 0xa7, 0x0f, 0x30, 0x68, 0x9b, 0x29, 0x7a, 0xfa, 0x63, 0xc1, + 0xc9, 0xd2, 0x64, 0x98, 0x0b, 0x87, 0x45, 0x95, 0xa6, 0x91, 0xfc, 0x74, 0xad, 0x89, 0x35, 0x3b, + 0x0e, 0x77, 0x25, 0xbb, 0x81, 0x61, 0x1e, 0x09, 0x2c, 0xdc, 0xe1, 0xc4, 0x9e, 0x8d, 0xee, 0xcf, + 0xbc, 0x7d, 0x1f, 0x2f, 0x50, 0x42, 0xd8, 0xc8, 0x6c, 0x0e, 0x43, 0x59, 0x25, 0x8a, 0xb3, 0x35, + 0x77, 0x6d, 0x72, 0xbd, 0x59, 0xa1, 0xa2, 0xc2, 0x86, 0x65, 0x0f, 0x30, 0xee, 0x79, 0x5d, 0x49, + 0xa2, 0x72, 0x55, 0xc9, 0xc4, 0x75, 0xb4, 0x8b, 0x8b, 0x9e, 0x1a, 0x2a, 0xf1, 0x4d, 0x26, 0xec, + 0x0a, 0x8e, 0x68, 0x5b, 0x2f, 0x8c, 0x1f, 0xee, 0x40, 0x73, 0x5d, 0x3d, 0xfd, 0xb2, 0xe0, 0xfc, + 0xcf, 0xb8, 0xfa, 0x44, 0x81, 0x09, 0xf2, 0x92, 0x64, 0xbb, 0x5f, 0x57, 0xb3, 0x09, 0x8c, 0x36, + 0x58, 0x70, 0x19, 0xe7, 0x35, 0xde, 0x36, 0x34, 0x3f, 0xb1, 0x47, 0xb8, 0xdc, 0x60, 0x2e, 0x91, + 0x37, 0x1e, 0x4d, 0xda, 0xd6, 0xf4, 0xd8, 0x90, 0x97, 0x7b, 0x75, 0xba, 0x06, 0xa7, 0x8e, 0x88, + 0x31, 0x70, 0xb2, 0x28, 0xc5, 0x76, 0xb4, 0x7e, 0xaf, 0x13, 0x57, 0xb7, 0x55, 0x2a, 0x9b, 0xed, + 0xc8, 0x5d, 0xc9, 0x6e, 0x95, 0xd9, 0x6a, 0xdd, 0x84, 0x6e, 0xff, 0x13, 0x7a, 0x47, 0x2c, 0xee, + 0xe0, 0x94, 0x53, 0x6a, 0x00, 0x0b, 0xd6, 0xdb, 0x3f, 0xa8, 0x6f, 0x3f, 0xb0, 0xbe, 0x07, 0xce, + 0xf3, 0x53, 0xf0, 0xb2, 0x3e, 0xd0, 0x7f, 0xc3, 0xfc, 0x37, 0x00, 0x00, 0xff, 0xff, 0x62, 0xd9, + 0x85, 0x51, 0x5c, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto new file mode 100644 index 0000000000..190f8af536 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto @@ -0,0 +1,158 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "DocumentationProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `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. +message Documentation { + // A short summary of what the service does. Can only be provided by + // plain text. + string summary = 1; + + // The top level pages for the documentation set. + repeated Page pages = 5; + + // A list of documentation rules that apply to individual API elements. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated DocumentationRule rules = 3; + + // The URL to the root of documentation. + string documentation_root_url = 4; + + // 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. + string overview = 2; +} + +// A documentation rule provides information about individual API elements. +message DocumentationRule { + // 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. + string selector = 1; + + // Description of the selected API(s). + string description = 2; + + // Deprecation description of the selected element(s). It can be provided if an + // element is marked as `deprecated`. + string deprecation_description = 3; +} + +// Represents a documentation page. A page can contain subpages to represent +// nested documentation set structure. +message Page { + // 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]`. + string name = 1; + + // The Markdown content of the page. You can use (== include {path} ==) + // to include content from a Markdown file. + string content = 2; + + // Subpages of this page. The order of subpages specified here will be + // honored in the generated docset. + repeated Page subpages = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go new file mode 100644 index 0000000000..c96d4f5559 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.pb.go @@ -0,0 +1,106 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// `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 +// apis: google.example.library.v1.Library +// allow_cors: true +// # Below entry makes 'google.example.library.v1.Library' +// # API be served from endpoint address +// # google.example.library-example.v1.LibraryManager. +// - name: library-manager.googleapis.com +// apis: google.example.library.v1.LibraryManager +// # BNS address for a borg job. Can specify a task by appending +// # "/taskId" (e.g. "/0") to the job spec. +// +// Example OpenAPI extension for endpoint with allow_cors set to true: +// +// { +// "swagger": "2.0", +// "info": { +// "description": "A simple..." +// }, +// "host": "MY_PROJECT_ID.appspot.com", +// "x-google-endpoints": [{ +// "name": "MY_PROJECT_ID.appspot.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"` + // 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 fileDescriptor8, []int{0} } + +func init() { + proto.RegisterType((*Endpoint)(nil), "google.api.Endpoint") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto", fileDescriptor8) +} + +var fileDescriptor8 = []byte{ + // 234 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x8f, 0xc1, 0x4a, 0x03, 0x31, + 0x10, 0x86, 0xd9, 0x76, 0xd5, 0xed, 0x80, 0x1e, 0x72, 0x0a, 0x05, 0xa1, 0x78, 0xea, 0x69, 0x73, + 0xf0, 0x09, 0xac, 0xa8, 0xf4, 0xb6, 0xf4, 0x05, 0x64, 0x5c, 0xa7, 0x21, 0x90, 0xce, 0x2c, 0x49, + 0xd4, 0x47, 0xf0, 0x3d, 0x7c, 0x52, 0xb3, 0x69, 0x57, 0xef, 0xbd, 0x84, 0x99, 0x2f, 0x3f, 0xff, + 0xff, 0x0f, 0x3c, 0x5b, 0x11, 0xeb, 0xa9, 0xb5, 0xe2, 0x91, 0x6d, 0x2b, 0xc1, 0x1a, 0x4b, 0x3c, + 0x04, 0x49, 0x62, 0x8e, 0x5f, 0x38, 0xb8, 0x68, 0xf2, 0x63, 0x22, 0x85, 0x4f, 0xd7, 0x53, 0x2f, + 0xbc, 0x77, 0xd6, 0x10, 0xbf, 0x0f, 0xe2, 0x38, 0xb5, 0x45, 0xab, 0xe0, 0xe4, 0x93, 0x85, 0xcb, + 0xed, 0xb9, 0x9e, 0xc8, 0x2c, 0x09, 0x93, 0x13, 0x8e, 0x47, 0xdb, 0xbb, 0xef, 0x0a, 0x9a, 0xa7, + 0x53, 0x92, 0x52, 0x50, 0x33, 0x1e, 0x48, 0x57, 0xab, 0x6a, 0xbd, 0xd8, 0x95, 0x59, 0x69, 0xb8, + 0x42, 0xef, 0x30, 0x52, 0xd4, 0xb3, 0xd5, 0x3c, 0xe3, 0x69, 0x1d, 0xd5, 0x63, 0x8c, 0x9e, 0x17, + 0x5c, 0x66, 0xb5, 0x84, 0x66, 0x4f, 0x98, 0x3e, 0x42, 0x96, 0xd7, 0x85, 0xff, 0xed, 0xea, 0x16, + 0x00, 0xbd, 0x97, 0xaf, 0xd7, 0x5e, 0x42, 0xd4, 0x17, 0x39, 0xa3, 0xd9, 0x2d, 0x0a, 0x79, 0xcc, + 0x60, 0xb3, 0x86, 0x9b, 0x5e, 0x0e, 0xed, 0xff, 0x99, 0x9b, 0xeb, 0xa9, 0x58, 0x37, 0x56, 0xed, + 0xaa, 0x9f, 0x59, 0xfd, 0xf2, 0xd0, 0x6d, 0xdf, 0x2e, 0x4b, 0xf5, 0xfb, 0xdf, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x2f, 0xf3, 0xbc, 0x78, 0x5b, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto new file mode 100644 index 0000000000..05da2f89fb --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto @@ -0,0 +1,89 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "EndpointProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `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 +// apis: google.example.library.v1.Library +// allow_cors: true +// # Below entry makes 'google.example.library.v1.Library' +// # API be served from endpoint address +// # google.example.library-example.v1.LibraryManager. +// - name: library-manager.googleapis.com +// apis: google.example.library.v1.LibraryManager +// # BNS address for a borg job. Can specify a task by appending +// # "/taskId" (e.g. "/0") to the job spec. +// +// Example OpenAPI extension for endpoint with allow_cors set to true: +// +// { +// "swagger": "2.0", +// "info": { +// "description": "A simple..." +// }, +// "host": "MY_PROJECT_ID.appspot.com", +// "x-google-endpoints": [{ +// "name": "MY_PROJECT_ID.appspot.com", +// "allow_cors": "true" +// }] +// } +message Endpoint { + // The canonical name of this endpoint. + string name = 1; + + // 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. + repeated string aliases = 2; + + // The list of APIs served by this endpoint. + repeated string apis = 3; + + // The list of features enabled on this endpoint. + repeated string features = 4; + + // 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. + bool allow_cors = 5; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.pb.go new file mode 100644 index 0000000000..98325ec737 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.pb.go @@ -0,0 +1,535 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/http.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// 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 fileDescriptor9, []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: +// +// ```proto +// 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 +// } +// ``` +// +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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. +// +// 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 response 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 fileDescriptor9, []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) 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) 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 fileDescriptor9, []int{2} } + +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.golang.org/genproto/googleapis/api/serviceconfig/http.proto", fileDescriptor9) +} + +var fileDescriptor9 = []byte{ + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x51, 0xcd, 0x4a, 0x2b, 0x31, + 0x14, 0xbe, 0xd3, 0x4e, 0xa7, 0xed, 0x29, 0x5c, 0xb8, 0xb9, 0x45, 0x82, 0x20, 0x48, 0x37, 0x16, + 0x17, 0x33, 0x50, 0x17, 0x2e, 0x5c, 0x39, 0x22, 0xd6, 0x5d, 0x99, 0x17, 0x90, 0xe9, 0x4c, 0x4c, + 0x83, 0xd3, 0x24, 0x4c, 0x4e, 0x05, 0x5f, 0xc7, 0x77, 0xf0, 0xdd, 0x5c, 0x9a, 0x64, 0x52, 0x5b, + 0x10, 0xdc, 0x84, 0xf3, 0xfd, 0x9c, 0x9f, 0x9c, 0x03, 0x39, 0x57, 0x8a, 0x37, 0x2c, 0xe5, 0xaa, + 0x29, 0x25, 0x4f, 0x55, 0xcb, 0x33, 0xce, 0xa4, 0x6e, 0x15, 0xaa, 0xac, 0x93, 0x4a, 0x2d, 0x4c, + 0x66, 0x9f, 0xcc, 0xb0, 0xf6, 0x55, 0x54, 0xac, 0x52, 0xf2, 0x59, 0xf0, 0x6c, 0x83, 0xa8, 0x53, + 0xef, 0x23, 0x10, 0x6a, 0x58, 0xd3, 0x6c, 0x01, 0xf1, 0xd2, 0x2a, 0xe4, 0x12, 0x06, 0xed, 0xae, + 0x61, 0x86, 0x46, 0xe7, 0xfd, 0xf9, 0x64, 0x31, 0x4d, 0x0f, 0x9e, 0xd4, 0x19, 0x0a, 0x2b, 0x16, + 0x9d, 0x65, 0xf6, 0xd1, 0x83, 0xd1, 0x9e, 0x23, 0xa7, 0x30, 0x32, 0xac, 0x61, 0x15, 0xaa, 0xd6, + 0xe6, 0x46, 0xf3, 0x71, 0xf1, 0x8d, 0x09, 0x81, 0x3e, 0x67, 0x48, 0x7b, 0x8e, 0x5e, 0xfe, 0x29, + 0x1c, 0x70, 0x9c, 0xde, 0x21, 0xed, 0xef, 0x39, 0x0b, 0xc8, 0x14, 0x62, 0xad, 0x0c, 0xd2, 0x38, + 0x90, 0x1e, 0x11, 0x0a, 0x49, 0x6d, 0x2b, 0x21, 0xa3, 0x83, 0xc0, 0x07, 0x4c, 0x4e, 0x60, 0xa0, + 0x4b, 0xac, 0x36, 0x34, 0x09, 0x42, 0x07, 0xc9, 0x35, 0x24, 0xd5, 0xce, 0xa0, 0xda, 0xd2, 0x91, + 0x15, 0x26, 0x8b, 0xb3, 0xe3, 0x5f, 0xdc, 0x79, 0xc5, 0xcd, 0xbd, 0x2a, 0x11, 0x59, 0x2b, 0x5d, + 0xc1, 0xce, 0x6e, 0x87, 0x8a, 0xd7, 0xaa, 0x7e, 0xa3, 0x43, 0xff, 0x01, 0x1f, 0x93, 0x7b, 0xf8, + 0x5f, 0xd6, 0xb5, 0x40, 0xa1, 0x64, 0xd9, 0x3c, 0xad, 0x85, 0xac, 0x85, 0xe4, 0x86, 0x4e, 0x7e, + 0xd9, 0x0f, 0x39, 0x24, 0xe4, 0xc1, 0x9f, 0x8f, 0x61, 0xa8, 0xbb, 0x7e, 0xb3, 0x1b, 0xf8, 0xf7, + 0x63, 0x08, 0xd7, 0xfa, 0xc5, 0x7a, 0xc3, 0xee, 0x7c, 0xec, 0x38, 0x9b, 0xb3, 0xe9, 0x16, 0x57, + 0xf8, 0x38, 0xbf, 0x80, 0xbf, 0x95, 0xda, 0x1e, 0xb5, 0xcd, 0xc7, 0xbe, 0x8c, 0xbb, 0xe8, 0x2a, + 0xfa, 0x8c, 0xa2, 0xf7, 0x5e, 0xfc, 0x70, 0xbb, 0x7a, 0x5c, 0x27, 0xfe, 0xc8, 0x57, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x32, 0x48, 0x5c, 0x87, 0x2a, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.proto new file mode 100644 index 0000000000..ad9406d291 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/http.proto @@ -0,0 +1,285 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// 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. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; +} + +// `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: +// +// ```proto +// 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 +// } +// ``` +// +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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: +// +// ```proto +// 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. +// +// 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. +message HttpRule { + // Selects methods to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // 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. + oneof pattern { + // Used for listing and getting information about resources. + string get = 2; + + // Used for updating a resource. + string put = 3; + + // Used for creating a resource. + string post = 4; + + // Used for deleting a resource. + string delete = 5; + + // Used for updating a resource. + string patch = 6; + + // Custom pattern is used for defining custom verbs. + CustomHttpPattern custom = 8; + } + + // 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 response message type. + string body = 7; + + // 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). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go new file mode 100644 index 0000000000..a1c41ee6e5 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.pb.go @@ -0,0 +1,80 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/log.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/serviceconfig" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import google_api1 "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_api1.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 fileDescriptor10, []int{0} } + +func (m *LogDescriptor) GetLabels() []*google_api1.LabelDescriptor { + if m != nil { + return m.Labels + } + return nil +} + +func init() { + proto.RegisterType((*LogDescriptor)(nil), "google.api.LogDescriptor") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/log.proto", fileDescriptor10) +} + +var fileDescriptor10 = []byte{ + // 233 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x72, 0x4c, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0x03, 0x09, + 0xfd, 0xe2, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0xd4, 0xe4, 0xfc, 0xbc, 0xb4, 0xcc, 0x74, 0xfd, 0x9c, + 0xfc, 0x74, 0x3d, 0xb0, 0x32, 0x21, 0x2e, 0xa8, 0x11, 0x40, 0x35, 0x52, 0xd6, 0xc4, 0x1b, 0x97, + 0x93, 0x98, 0x94, 0x9a, 0x03, 0x21, 0x21, 0x06, 0x29, 0xcd, 0x65, 0xe4, 0xe2, 0xf5, 0xc9, 0x4f, + 0x77, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0x12, 0x12, 0xe2, 0x62, 0xc9, 0x4b, + 0xcc, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x8c, 0xb9, 0xd8, 0xc0, + 0x9a, 0x8a, 0x25, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0xa4, 0xf5, 0x10, 0xf6, 0xeb, 0xf9, 0x80, + 0x64, 0x10, 0x06, 0x04, 0x41, 0x95, 0x0a, 0x29, 0x70, 0x71, 0xa7, 0x40, 0x45, 0x33, 0xf3, 0xf3, + 0x24, 0x98, 0xc1, 0xe6, 0x21, 0x0b, 0x09, 0x29, 0x72, 0xf1, 0xa4, 0x64, 0x16, 0x17, 0xe4, 0x24, + 0x56, 0xc6, 0x83, 0xad, 0x64, 0x81, 0x2a, 0x81, 0x88, 0xf9, 0x01, 0x85, 0x9c, 0x94, 0xb9, 0xf8, + 0x92, 0xf3, 0x73, 0x91, 0xac, 0x73, 0xe2, 0x00, 0x3a, 0x37, 0x00, 0xe4, 0xf6, 0x00, 0xc6, 0x45, + 0x4c, 0x2c, 0xee, 0x8e, 0x01, 0x9e, 0x49, 0x6c, 0x60, 0xbf, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x32, 0x96, 0x08, 0x72, 0x59, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.proto new file mode 100644 index 0000000000..e258b8a094 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/log.proto @@ -0,0 +1,54 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/label/label.proto"; // from google/api/label.proto + +option java_multiple_files = true; +option java_outer_classname = "LogProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// 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 +message LogDescriptor { + // 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 [/_-.]. + string name = 1; + + // The set of labels that are available to describe a specific log entry. + // Runtime requests that contain labels not specified here are + // considered invalid. + repeated LabelDescriptor labels = 2; + + // A human-readable description of this log. This information appears in + // the documentation and can contain details. + string description = 3; + + // The human-readable name for this log. This information appears on + // the user interface and should be concise. + string display_name = 4; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go new file mode 100644 index 0000000000..03de39682e --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.pb.go @@ -0,0 +1,123 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// 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 `library.googleapis.com/activity_history` log is +// sent to both the producer and consumer projects, whereas +// the `library.googleapis.com/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: library.googleapis.com/activity_history +// labels: +// - key: /customer_id +// - name: library.googleapis.com/purchase_history +// logging: +// producer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - library.googleapis.com/activity_history +// - library.googleapis.com/purchase_history +// consumer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - library.googleapis.com/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 fileDescriptor11, []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 + // [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. + 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 fileDescriptor11, []int{0, 0} } + +func init() { + proto.RegisterType((*Logging)(nil), "google.api.Logging") + proto.RegisterType((*Logging_LoggingDestination)(nil), "google.api.Logging.LoggingDestination") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto", fileDescriptor11) +} + +var fileDescriptor11 = []byte{ + // 264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x90, 0xc1, 0x4a, 0xc4, 0x30, + 0x10, 0x86, 0x69, 0x77, 0x51, 0x36, 0x8a, 0x60, 0x50, 0x58, 0xf6, 0xb4, 0x78, 0xd0, 0xbd, 0xd8, + 0x80, 0x3e, 0x81, 0x8b, 0x22, 0x0b, 0x1e, 0x4a, 0x2f, 0x1e, 0x3c, 0x2c, 0x35, 0x1d, 0x87, 0x40, + 0x9b, 0x59, 0x92, 0xd4, 0xa7, 0xf1, 0xe4, 0x93, 0x9a, 0x6d, 0x52, 0x5b, 0xf4, 0xa4, 0x97, 0x24, + 0xcc, 0xfc, 0xf3, 0xcd, 0x9f, 0x9f, 0x3d, 0x20, 0x11, 0xd6, 0x90, 0x21, 0xd5, 0xa5, 0xc6, 0x8c, + 0x0c, 0x0a, 0x04, 0xbd, 0x33, 0xe4, 0x48, 0x84, 0x56, 0xb9, 0x53, 0x56, 0xf8, 0x43, 0x58, 0x30, + 0xef, 0x4a, 0x82, 0x24, 0xfd, 0xa6, 0x50, 0xd4, 0x84, 0xa8, 0xfc, 0x44, 0x27, 0xe5, 0x2c, 0x62, + 0xbc, 0x6e, 0xb1, 0xf9, 0x2f, 0xb2, 0xd4, 0x9a, 0x5c, 0xe9, 0x14, 0x69, 0x1b, 0xb0, 0x17, 0x1f, + 0x29, 0x3b, 0x7c, 0x0a, 0x8b, 0xf8, 0x0b, 0x3b, 0xf7, 0xc5, 0xaa, 0x95, 0x60, 0xb6, 0x15, 0x58, + 0xa7, 0x74, 0x90, 0xce, 0x93, 0xe5, 0x64, 0x75, 0x74, 0x73, 0x99, 0x0d, 0x16, 0xb2, 0x38, 0xd3, + 0xdf, 0xf7, 0x83, 0xbc, 0x38, 0xeb, 0x21, 0xa3, 0xa2, 0xdd, 0xc3, 0xbd, 0x09, 0xdb, 0x36, 0x3f, + 0xe1, 0xe9, 0xdf, 0xe0, 0x3d, 0x64, 0x0c, 0x5f, 0x3c, 0x33, 0xfe, 0x5b, 0xcb, 0xaf, 0x19, 0x6f, + 0x48, 0x2b, 0x47, 0x06, 0xaa, 0xad, 0x01, 0x4b, 0xad, 0x91, 0x30, 0x9f, 0x2c, 0x93, 0xd5, 0xac, + 0x38, 0xfd, 0xee, 0x14, 0xb1, 0xc1, 0x39, 0x9b, 0xfa, 0xc8, 0xc3, 0x6f, 0x67, 0x45, 0xf7, 0x5e, + 0x5f, 0xb1, 0x13, 0x49, 0xcd, 0xc8, 0xdb, 0xfa, 0x38, 0x2e, 0xca, 0xf7, 0xf1, 0xe5, 0xc9, 0x67, + 0x3a, 0x7d, 0xbc, 0xcb, 0x37, 0xaf, 0x07, 0x5d, 0x9c, 0xb7, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x48, 0x22, 0x03, 0x10, 0xee, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto new file mode 100644 index 0000000000..d37ddbb668 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto @@ -0,0 +1,82 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "LoggingProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// 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 `library.googleapis.com/activity_history` log is +// sent to both the producer and consumer projects, whereas +// the `library.googleapis.com/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: library.googleapis.com/activity_history +// labels: +// - key: /customer_id +// - name: library.googleapis.com/purchase_history +// logging: +// producer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - library.googleapis.com/activity_history +// - library.googleapis.com/purchase_history +// consumer_destinations: +// - monitored_resource: library.googleapis.com/branch +// logs: +// - library.googleapis.com/activity_history +message Logging { + // Configuration of a specific logging destination (the producer project + // or the consumer project). + message LoggingDestination { + // The monitored resource type. The type must be defined in + // [Service.monitored_resources][google.api.Service.monitored_resources] section. + string monitored_resource = 3; + + // Names of the logs to be sent to this destination. Each name must + // be defined in the [Service.logs][google.api.Service.logs] section. + repeated string logs = 1; + } + + // 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. + repeated LoggingDestination producer_destinations = 1; + + // 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. + repeated LoggingDestination consumer_destinations = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go new file mode 100644 index 0000000000..8defab33dc --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.pb.go @@ -0,0 +1,131 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// 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 fileDescriptor12, []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 fileDescriptor12, []int{0, 0} +} + +func init() { + proto.RegisterType((*Monitoring)(nil), "google.api.Monitoring") + proto.RegisterType((*Monitoring_MonitoringDestination)(nil), "google.api.Monitoring.MonitoringDestination") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto", fileDescriptor12) +} + +var fileDescriptor12 = []byte{ + // 264 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x90, 0xd1, 0x4a, 0xc3, 0x30, + 0x14, 0x86, 0x69, 0x15, 0x65, 0x47, 0x50, 0x0c, 0x0e, 0xc6, 0xae, 0xc4, 0xab, 0x21, 0xda, 0x80, + 0x3e, 0x81, 0x43, 0xd0, 0x5d, 0x08, 0xa5, 0x2f, 0x30, 0x63, 0x7a, 0x0c, 0x81, 0x35, 0x67, 0x9c, + 0xa4, 0x3e, 0x90, 0xcf, 0xe0, 0x03, 0x9a, 0xad, 0xed, 0x5a, 0xc4, 0xab, 0xde, 0x84, 0xe4, 0x9c, + 0xff, 0xfc, 0xdf, 0x9f, 0x03, 0xaf, 0x86, 0xc8, 0x6c, 0x30, 0x33, 0xb4, 0x51, 0xce, 0x64, 0xc4, + 0x46, 0x1a, 0x74, 0x5b, 0xa6, 0x40, 0xb2, 0x69, 0xa9, 0xad, 0xf5, 0x32, 0x1e, 0xd2, 0x23, 0x7f, + 0x59, 0x8d, 0x9a, 0xdc, 0xa7, 0x35, 0xb2, 0x22, 0x67, 0x03, 0xb1, 0x8d, 0x43, 0x7b, 0xb5, 0x80, + 0xd6, 0x29, 0x4a, 0xe7, 0xab, 0xb1, 0xae, 0xca, 0x39, 0x0a, 0x2a, 0x58, 0x72, 0xbe, 0xb1, 0xbd, + 0xf9, 0x49, 0x01, 0xde, 0x0e, 0x2c, 0xa1, 0x60, 0x1a, 0xeb, 0x65, 0xad, 0x91, 0xd7, 0x25, 0xfa, + 0x60, 0x5d, 0xa3, 0x9e, 0x25, 0xd7, 0x47, 0x8b, 0xb3, 0x87, 0xbb, 0xac, 0x4f, 0x91, 0xf5, 0x63, + 0x83, 0xeb, 0x73, 0x3f, 0x54, 0x5c, 0x75, 0x56, 0x83, 0xa2, 0xdf, 0x21, 0x62, 0x1a, 0x5f, 0x57, + 0x7f, 0x11, 0xe9, 0x18, 0x44, 0x67, 0x35, 0x44, 0xcc, 0xdf, 0x61, 0xfa, 0xaf, 0x5c, 0xdc, 0x83, + 0x68, 0x17, 0x8b, 0xe5, 0x9a, 0xd1, 0x53, 0xcd, 0x1a, 0xe3, 0xdf, 0x92, 0xc5, 0xa4, 0xb8, 0x3c, + 0x74, 0x8a, 0xb6, 0x21, 0x66, 0x70, 0x5a, 0x61, 0x60, 0xab, 0x9b, 0x70, 0x93, 0xa2, 0x7b, 0x2e, + 0x6f, 0xe1, 0x5c, 0x53, 0x35, 0x88, 0xba, 0xbc, 0xe8, 0x89, 0xf9, 0x6e, 0xb3, 0x79, 0xf2, 0x9d, + 0x1e, 0xbf, 0x3c, 0xe5, 0xab, 0x8f, 0x93, 0xfd, 0xa6, 0x1f, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, + 0x1a, 0x02, 0x76, 0xbb, 0x0c, 0x02, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto new file mode 100644 index 0000000000..d29cbe5a32 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto @@ -0,0 +1,88 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "MonitoringProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// 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 +message Monitoring { + // Configuration of a specific monitoring destination (the producer project + // or the consumer project). + message MonitoringDestination { + // The monitored resource type. The type must be defined in + // [Service.monitored_resources][google.api.Service.monitored_resources] section. + string monitored_resource = 1; + + // Names of the metrics to report to this monitoring destination. + // Each name must be defined in [Service.metrics][google.api.Service.metrics] section. + repeated string metrics = 2; + } + + // 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. + repeated MonitoringDestination producer_destinations = 1; + + // 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. + repeated MonitoringDestination consumer_destinations = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go new file mode 100644 index 0000000000..5ed55f205b --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.pb.go @@ -0,0 +1,305 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/service.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/serviceconfig" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/label" +import google_api2 "google.golang.org/genproto/googleapis/api/metric" +import google_api3 "google.golang.org/genproto/googleapis/api/monitoredres" +import _ "github.com/golang/protobuf/ptypes/any" +import google_protobuf4 "google.golang.org/genproto/protobuf" +import google_protobuf3 "google.golang.org/genproto/protobuf" +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 the configuration schema. It +// describes basic information like the name of the service and the +// exposed API interfaces, and delegates other aspects to configuration +// sub-sections. +// +// Example: +// +// type: google.api.Service +// config_version: 1 +// name: calendar.googleapis.com +// title: Google Calendar API +// apis: +// - name: google.calendar.Calendar +// backend: +// rules: +// - selector: "*" +// address: calendar.example.com +type Service struct { + // The version of the service configuration. The config version may + // influence interpretation of the configuration, for example, to + // determine defaults. This is documented together with applicable + // options. The current default for the config version itself 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 associated with this service. + Title string `protobuf:"bytes,2,opt,name=title" json:"title,omitempty"` + // The id of the Google developer project that owns the service. + // Members of this project can manage the service configuration, + // manage consumption of the service, etc. + 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 *Http `protobuf:"bytes,9,opt,name=http" json:"http,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_api2.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_api3.MonitoredResourceDescriptor `protobuf:"bytes,25,rep,name=monitored_resources,json=monitoredResources" json:"monitored_resources,omitempty"` + // Logging configuration of the service. + Logging *Logging `protobuf:"bytes,27,opt,name=logging" json:"logging,omitempty"` + // Monitoring configuration of the service. + Monitoring *Monitoring `protobuf:"bytes,28,opt,name=monitoring" json:"monitoring,omitempty"` + // Configuration for system parameters. + SystemParameters *SystemParameters `protobuf:"bytes,29,opt,name=system_parameters,json=systemParameters" json:"system_parameters,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 fileDescriptor13, []int{0} } + +func (m *Service) GetConfigVersion() *google_protobuf5.UInt32Value { + if m != nil { + return m.ConfigVersion + } + return nil +} + +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() *Http { + if m != nil { + return m.Http + } + 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_api2.MetricDescriptor { + if m != nil { + return m.Metrics + } + return nil +} + +func (m *Service) GetMonitoredResources() []*google_api3.MonitoredResourceDescriptor { + if m != nil { + return m.MonitoredResources + } + 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 init() { + proto.RegisterType((*Service)(nil), "google.api.Service") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/service.proto", fileDescriptor13) +} + +var fileDescriptor13 = []byte{ + // 772 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x95, 0x6b, 0x4f, 0xd4, 0x4c, + 0x14, 0xc7, 0x03, 0x2c, 0xb7, 0xe1, 0xf2, 0xc0, 0x70, 0x79, 0x86, 0x15, 0x13, 0x34, 0x26, 0x90, + 0x18, 0xda, 0x04, 0x12, 0x13, 0x63, 0x8c, 0xd9, 0x05, 0x94, 0x8d, 0xa8, 0x9b, 0x41, 0x88, 0xef, + 0x36, 0xdd, 0xee, 0x50, 0xaa, 0xdd, 0x99, 0xa6, 0x9d, 0xa2, 0x7c, 0x1d, 0x3f, 0x8b, 0x1f, 0xcc, + 0xd3, 0xb9, 0xb0, 0xed, 0x2e, 0x2a, 0x16, 0x5f, 0xec, 0xb6, 0x9d, 0xf3, 0xfb, 0xff, 0xe7, 0x9c, + 0x99, 0xcc, 0x19, 0x74, 0x14, 0x08, 0x11, 0x44, 0xcc, 0x09, 0x44, 0xe4, 0xf1, 0xc0, 0x11, 0x49, + 0xe0, 0x06, 0x8c, 0xc7, 0x89, 0x90, 0xc2, 0xd5, 0x21, 0x2f, 0x0e, 0x53, 0x17, 0xfe, 0xdc, 0x94, + 0x25, 0x57, 0xa1, 0xcf, 0x7c, 0xc1, 0x2f, 0xc2, 0xc0, 0x7e, 0x39, 0x0a, 0xc5, 0xc8, 0xd8, 0x00, + 0x57, 0x6f, 0x55, 0xb5, 0xf4, 0x38, 0x17, 0xd2, 0x93, 0xa1, 0xe0, 0xa9, 0xb6, 0xad, 0x37, 0x2b, + 0x5b, 0x65, 0xf2, 0xd2, 0x78, 0x54, 0xae, 0xb0, 0xeb, 0xf9, 0x5f, 0x18, 0xef, 0xdd, 0xd7, 0x06, + 0x1e, 0x92, 0x7d, 0x93, 0xff, 0xc2, 0x26, 0x11, 0x91, 0xb1, 0x79, 0x5b, 0xd5, 0xa6, 0x27, 0xfc, + 0xac, 0xcf, 0xb8, 0x5e, 0x66, 0x63, 0xf6, 0xba, 0xaa, 0x19, 0xac, 0x4e, 0x2c, 0x42, 0x2e, 0xef, + 0xbb, 0x5b, 0x97, 0x52, 0xc6, 0xc6, 0xe3, 0xc5, 0xdd, 0x3d, 0x22, 0xaf, 0xcb, 0x22, 0xfd, 0x6f, + 0xc4, 0x8d, 0xaa, 0x09, 0x44, 0x22, 0xb8, 0xef, 0xfe, 0x80, 0x45, 0x10, 0x72, 0x6b, 0xf3, 0xf2, + 0xee, 0x36, 0x7d, 0x26, 0x93, 0xd0, 0x37, 0x0f, 0x23, 0xff, 0xf0, 0x17, 0x72, 0xc1, 0x43, 0x29, + 0x12, 0xd6, 0x4b, 0x58, 0x3a, 0xf8, 0xe8, 0xc0, 0x97, 0xc8, 0x12, 0x7b, 0x3e, 0xeb, 0xc7, 0x55, + 0xcb, 0x32, 0x8e, 0x83, 0xca, 0xde, 0x57, 0x6e, 0x18, 0xd7, 0xa9, 0x64, 0xfd, 0x4e, 0xec, 0x25, + 0x1e, 0xd4, 0xca, 0x12, 0xe3, 0x77, 0x50, 0xd5, 0x2f, 0x4b, 0xbd, 0xc0, 0x96, 0xe7, 0x06, 0xa1, + 0xbc, 0xcc, 0xba, 0x8e, 0x2f, 0xfa, 0xae, 0x36, 0x72, 0x55, 0xa0, 0x9b, 0x5d, 0xb8, 0xb1, 0xbc, + 0x8e, 0x61, 0x69, 0x3c, 0x7e, 0x9d, 0xff, 0x8c, 0x60, 0xf7, 0x37, 0xb3, 0xde, 0x28, 0x61, 0x4e, + 0x83, 0x3b, 0x77, 0xc1, 0xf3, 0x79, 0x0c, 0xff, 0xfc, 0xcf, 0xf9, 0x7c, 0x4d, 0xbc, 0x38, 0x66, + 0xc9, 0xe0, 0x45, 0x4b, 0x1f, 0xff, 0x98, 0x41, 0xd3, 0xa7, 0xba, 0x50, 0x7c, 0x80, 0x16, 0x75, + 0xb1, 0x9d, 0x2b, 0x00, 0xe0, 0xc0, 0x92, 0xd5, 0xad, 0xb1, 0x9d, 0xb9, 0xbd, 0x4d, 0x9b, 0x8f, + 0x35, 0x75, 0xce, 0x5a, 0x5c, 0xee, 0xef, 0x9d, 0x7b, 0x51, 0xc6, 0xe8, 0x82, 0xd6, 0x9c, 0x6b, + 0x09, 0xc6, 0xa8, 0xc6, 0x61, 0xc5, 0xc9, 0x18, 0x48, 0x67, 0xa9, 0x7a, 0xc7, 0x8b, 0x68, 0x3c, + 0xec, 0x91, 0x47, 0x6a, 0x04, 0xde, 0xf0, 0x2a, 0x9a, 0x94, 0xa1, 0x8c, 0x18, 0x19, 0x57, 0x43, + 0xfa, 0x03, 0x3b, 0x68, 0x05, 0x26, 0xe8, 0x65, 0x3e, 0x4b, 0x3a, 0xf0, 0xf2, 0x99, 0xf9, 0xb2, + 0x03, 0xb2, 0x75, 0xc5, 0x2c, 0xdb, 0x50, 0x5b, 0x47, 0x5a, 0x3d, 0xbc, 0x83, 0x6a, 0xf9, 0x5e, + 0x91, 0x89, 0xad, 0x09, 0x48, 0x72, 0x75, 0x24, 0xc9, 0x46, 0x1c, 0x52, 0x45, 0xe0, 0xa7, 0x30, + 0x5f, 0xbe, 0x0a, 0xa4, 0xa6, 0xd0, 0xb5, 0x11, 0xf4, 0x23, 0x44, 0xa9, 0x66, 0x72, 0x98, 0xf1, + 0xac, 0x9f, 0x92, 0xc9, 0x5f, 0xc0, 0x47, 0x10, 0xa5, 0x9a, 0xc1, 0xaf, 0xd0, 0x42, 0xa9, 0xc5, + 0x91, 0x29, 0xb5, 0x62, 0x1b, 0xce, 0xe0, 0x82, 0x72, 0x0e, 0x8b, 0x00, 0x2d, 0xf3, 0x78, 0x17, + 0x4d, 0x9b, 0xc6, 0x4f, 0x66, 0x94, 0x74, 0xa5, 0x28, 0x6d, 0xea, 0x10, 0xb5, 0x0c, 0x7e, 0x82, + 0x6a, 0x79, 0xf7, 0x22, 0xb3, 0x8a, 0x5d, 0x2a, 0xb2, 0xc7, 0x30, 0x4e, 0x55, 0x14, 0x37, 0xd1, + 0x62, 0x7e, 0x23, 0xc1, 0x24, 0xa1, 0xaf, 0xd3, 0x9a, 0x53, 0x7c, 0xbd, 0xc8, 0x37, 0x4a, 0x04, + 0x1d, 0x52, 0xe4, 0x89, 0x99, 0xab, 0x84, 0xcc, 0x8f, 0x26, 0x76, 0xa0, 0x43, 0xd4, 0x32, 0x78, + 0x1b, 0x4d, 0xaa, 0x13, 0x42, 0xfe, 0x53, 0xf0, 0x72, 0x11, 0x3e, 0xcb, 0x03, 0x54, 0xc7, 0xf1, + 0x1e, 0x9a, 0xb5, 0x7d, 0x3c, 0x25, 0xb8, 0xbc, 0x75, 0x39, 0x7c, 0x64, 0x82, 0x74, 0x80, 0xd9, + 0x5c, 0xe0, 0x3e, 0x22, 0x6b, 0xb7, 0xe7, 0x02, 0x21, 0x6a, 0x19, 0xc0, 0x6b, 0xd0, 0x1e, 0x53, + 0xf2, 0xbf, 0x72, 0x2f, 0xed, 0xc5, 0x89, 0x08, 0x0e, 0x59, 0xea, 0x27, 0x61, 0x0c, 0x5d, 0x86, + 0x2a, 0x0c, 0x3f, 0x43, 0xd3, 0xba, 0x1b, 0xa6, 0x84, 0x28, 0xc5, 0x66, 0x51, 0xf1, 0x4e, 0x85, + 0x0a, 0x22, 0x0b, 0xe3, 0x4f, 0x68, 0x65, 0xb4, 0x01, 0xa6, 0x64, 0x43, 0x79, 0x6c, 0x97, 0x3c, + 0x2c, 0x46, 0x0d, 0x55, 0xb0, 0xc3, 0xfd, 0xe1, 0xa0, 0xaa, 0xd7, 0xf4, 0x77, 0xf2, 0x60, 0xb4, + 0xde, 0x13, 0x1d, 0xa2, 0x96, 0x81, 0x02, 0xd0, 0xa0, 0x6f, 0x92, 0x4d, 0xa5, 0x58, 0xbf, 0x65, + 0xfe, 0x5c, 0x54, 0x20, 0x71, 0x0b, 0x2d, 0x0f, 0x77, 0xc9, 0x94, 0x3c, 0x2c, 0x1f, 0xf9, 0x5c, + 0x7e, 0xaa, 0xa0, 0xf6, 0x0d, 0x43, 0x97, 0xd2, 0xa1, 0x91, 0xe6, 0x76, 0xde, 0x3a, 0xfa, 0x05, + 0x51, 0x73, 0xde, 0x74, 0x95, 0x76, 0x7e, 0x6c, 0xda, 0x63, 0xdf, 0xc7, 0x6b, 0x6f, 0x1a, 0xed, + 0x56, 0x77, 0x4a, 0x1d, 0xa3, 0xfd, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x22, 0x08, 0x2f, + 0x09, 0x0a, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.proto new file mode 100644 index 0000000000..bbcd9f1c3a --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/service.proto @@ -0,0 +1,157 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/auth.proto"; // from google/api/auth.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/backend.proto"; // from google/api/backend.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/context.proto"; // from google/api/context.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/control.proto"; // from google/api/control.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/documentation.proto"; // from google/api/documentation.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/endpoint.proto"; // from google/api/endpoint.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/http.proto"; // from google/api/http.proto +import "google.golang.org/genproto/googleapis/api/label/label.proto"; // from google/api/label.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/log.proto"; // from google/api/log.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/logging.proto"; // from google/api/logging.proto +import "google.golang.org/genproto/googleapis/api/metric/metric.proto"; // from google/api/metric.proto +import "google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto"; // from google/api/monitored_resource.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/monitoring.proto"; // from google/api/monitoring.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto"; // from google/api/system_parameter.proto +import "google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto"; // from google/api/usage.proto +import "github.com/golang/protobuf/ptypes/any/any.proto"; // from google/protobuf/any.proto +import "google.golang.org/genproto/protobuf/api.proto"; // from google/protobuf/api.proto +import "google.golang.org/genproto/protobuf/type.proto"; // from google/protobuf/type.proto +import "github.com/golang/protobuf/ptypes/wrappers/wrappers.proto"; // from google/protobuf/wrappers.proto + +option java_multiple_files = true; +option java_outer_classname = "ServiceProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// `Service` is the root object of the configuration schema. It +// describes basic information like the name of the service and the +// exposed API interfaces, and delegates other aspects to configuration +// sub-sections. +// +// Example: +// +// type: google.api.Service +// config_version: 1 +// name: calendar.googleapis.com +// title: Google Calendar API +// apis: +// - name: google.calendar.Calendar +// backend: +// rules: +// - selector: "*" +// address: calendar.example.com +message Service { + // The version of the service configuration. The config version may + // influence interpretation of the configuration, for example, to + // determine defaults. This is documented together with applicable + // options. The current default for the config version itself is `3`. + google.protobuf.UInt32Value config_version = 20; + + // The DNS address at which this service is available, + // e.g. `calendar.googleapis.com`. + string name = 1; + + // 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. + string id = 33; + + // The product title associated with this service. + string title = 2; + + // The id of the Google developer project that owns the service. + // Members of this project can manage the service configuration, + // manage consumption of the service, etc. + string producer_project_id = 22; + + // 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. + repeated google.protobuf.Api apis = 3; + + // 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 + repeated google.protobuf.Type types = 4; + + // 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 + repeated google.protobuf.Enum enums = 5; + + // Additional API documentation. + Documentation documentation = 6; + + // API backend configuration. + Backend backend = 8; + + // HTTP configuration. + Http http = 9; + + // Auth configuration. + Authentication authentication = 11; + + // Context configuration. + Context context = 12; + + // Configuration controlling usage of this service. + Usage usage = 15; + + // 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. + repeated Endpoint endpoints = 18; + + // Configuration for the service control plane. + Control control = 21; + + // Defines the logs used by this service. + repeated LogDescriptor logs = 23; + + // Defines the metrics used by this service. + repeated MetricDescriptor metrics = 24; + + // 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. + repeated MonitoredResourceDescriptor monitored_resources = 25; + + // Logging configuration of the service. + Logging logging = 27; + + // Monitoring configuration of the service. + Monitoring monitoring = 28; + + // Configuration for system parameters. + SystemParameters system_parameters = 29; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go new file mode 100644 index 0000000000..97705e6fd2 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.pb.go @@ -0,0 +1,146 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 and alt name for all methods + // + // system_parameters + // rules: + // - selector: "*" + // parameters: + // - name: api_key + // url_query_parameter: api_key + // - name: alt + // http_header: Response-Content-Type + // + // 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) 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", "alt", "callback", + // and etc. 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 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.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto", fileDescriptor14) +} + +var fileDescriptor14 = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x90, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0xc6, 0x95, 0xb6, 0x20, 0xb8, 0x4a, 0xfc, 0x71, 0x19, 0x22, 0x18, 0x8a, 0x32, 0x75, 0xb2, + 0x25, 0x10, 0x13, 0x13, 0x5d, 0xa0, 0x0b, 0x0a, 0xe1, 0x01, 0xa2, 0x10, 0x0e, 0x37, 0x52, 0x62, + 0x87, 0xb3, 0x53, 0xa9, 0xaf, 0xc3, 0x93, 0xe2, 0xb8, 0x25, 0xad, 0x22, 0xd4, 0xc5, 0x3a, 0xdf, + 0xf7, 0xbb, 0xfb, 0x4e, 0x1f, 0xbc, 0x4a, 0xad, 0x65, 0x89, 0x5c, 0xea, 0x32, 0x53, 0x92, 0x6b, + 0x92, 0x42, 0xa2, 0xaa, 0x49, 0x5b, 0x2d, 0x36, 0x52, 0x56, 0x17, 0x46, 0xb8, 0x47, 0x18, 0xa4, + 0x55, 0x91, 0x63, 0xae, 0xd5, 0x57, 0x21, 0x85, 0x59, 0x1b, 0x8b, 0x55, 0x5a, 0x67, 0x94, 0x55, + 0x68, 0x91, 0xb8, 0x9f, 0x61, 0xb0, 0xdd, 0xe7, 0x06, 0xa2, 0x05, 0x5c, 0xbc, 0x7b, 0x2a, 0xfe, + 0x83, 0x0c, 0x7b, 0x80, 0x23, 0x6a, 0x4a, 0x34, 0x61, 0x70, 0x3b, 0x9c, 0x8d, 0xef, 0xa6, 0x7c, + 0xc7, 0xf3, 0x1e, 0x9c, 0x38, 0x2e, 0xd9, 0xd0, 0x91, 0x82, 0xc9, 0x3f, 0x2a, 0xbb, 0x86, 0x13, + 0x83, 0x25, 0xe6, 0x56, 0x93, 0x5b, 0x18, 0xcc, 0x4e, 0x93, 0xee, 0xcf, 0x1e, 0x01, 0xba, 0xe3, + 0x4c, 0x38, 0xf0, 0x76, 0x37, 0x87, 0xec, 0xf6, 0xf0, 0x68, 0x05, 0xe7, 0x3d, 0x99, 0x31, 0x18, + 0x29, 0x57, 0x6e, 0x7d, 0x7c, 0xcd, 0xa6, 0x30, 0x5e, 0x5a, 0x5b, 0xa7, 0x4b, 0xcc, 0x3e, 0x91, + 0x9c, 0x49, 0x2b, 0x41, 0xdb, 0x7a, 0xf1, 0x1d, 0xc6, 0x61, 0xd2, 0x50, 0x99, 0x7e, 0x37, 0x48, + 0xeb, 0x5d, 0x56, 0xe1, 0xd0, 0x83, 0x97, 0x4e, 0x7a, 0x6b, 0x95, 0xce, 0x64, 0x2e, 0xe0, 0x2c, + 0xd7, 0xd5, 0xde, 0x95, 0xf3, 0xab, 0xde, 0x1d, 0x71, 0x1b, 0x73, 0x1c, 0xfc, 0x0c, 0x46, 0xcf, + 0x4f, 0xf1, 0xe2, 0xe3, 0xd8, 0xc7, 0x7e, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x56, 0xd1, 0x77, + 0xac, 0xc8, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto new file mode 100644 index 0000000000..ebd11039b8 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/system_parameter.proto @@ -0,0 +1,97 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +option java_multiple_files = true; +option java_outer_classname = "SystemParameterProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// ### 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. +message SystemParameters { + // 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 and alt name for all methods + // + // system_parameters + // rules: + // - selector: "*" + // parameters: + // - name: api_key + // url_query_parameter: api_key + // - name: alt + // http_header: Response-Content-Type + // + // 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. + repeated SystemParameterRule rules = 1; +} + +// Define a system parameter rule mapping system parameter definitions to +// methods. +message SystemParameterRule { + // 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. + string selector = 1; + + // 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. + repeated SystemParameter parameters = 2; +} + +// 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. +message SystemParameter { + // Define the name of the parameter, such as "api_key", "alt", "callback", + // and etc. It is case sensitive. + string name = 1; + + // Define the HTTP header name to use for the parameter. It is case + // insensitive. + string http_header = 2; + + // Define the URL query parameter name to use for the parameter. It is case + // sensitive. + string url_query_parameter = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go new file mode 100644 index 0000000000..148f1b3048 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto +// DO NOT EDIT! + +package google_api // import "google.golang.org/genproto/googleapis/api/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 + +// 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"` +} + +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) GetRules() []*UsageRule { + if m != nil { + return m.Rules + } + return nil +} + +// 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"` +} + +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 init() { + proto.RegisterType((*Usage)(nil), "google.api.Usage") + proto.RegisterType((*UsageRule)(nil), "google.api.UsageRule") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto", fileDescriptor15) +} + +var fileDescriptor15 = []byte{ + // 254 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x8f, 0xc1, 0x4a, 0x03, 0x31, + 0x10, 0x86, 0xd9, 0x6a, 0x4b, 0x3b, 0x8a, 0x87, 0x05, 0x65, 0xe9, 0x49, 0x16, 0x04, 0x41, 0x48, + 0x40, 0x2f, 0x5e, 0x6d, 0x0f, 0xd2, 0xdb, 0xb2, 0x50, 0xf0, 0x56, 0x62, 0x1c, 0x43, 0x20, 0xcd, + 0xd4, 0x4c, 0x56, 0xdf, 0xc7, 0x27, 0x35, 0x9b, 0x95, 0x5a, 0xaf, 0xbd, 0x04, 0xf2, 0x7f, 0x3f, + 0xdf, 0xcc, 0xc0, 0xd2, 0x10, 0x19, 0x87, 0xc2, 0x90, 0x53, 0xde, 0x08, 0x0a, 0x46, 0x1a, 0xf4, + 0xbb, 0x40, 0x91, 0xe4, 0x80, 0xd4, 0xce, 0xb2, 0x4c, 0x8f, 0x64, 0x0c, 0x9f, 0x56, 0xa3, 0x26, + 0xff, 0x6e, 0x8d, 0xec, 0x58, 0x19, 0x14, 0xb9, 0x58, 0xc2, 0xaf, 0x24, 0xb5, 0xe6, 0xab, 0x63, + 0x85, 0xca, 0x7b, 0x8a, 0x2a, 0x5a, 0xf2, 0x3c, 0x68, 0xeb, 0x17, 0x18, 0xaf, 0xfb, 0x29, 0x65, + 0x0d, 0xe7, 0x01, 0x3f, 0x3a, 0x1b, 0x70, 0x8b, 0x3e, 0x72, 0x55, 0x5c, 0x9f, 0xdc, 0xce, 0xda, + 0x7f, 0x59, 0x79, 0x07, 0xe3, 0xd0, 0x39, 0xe4, 0x6a, 0x92, 0xe0, 0xd9, 0xfd, 0xa5, 0xf8, 0xdb, + 0x49, 0x64, 0x4b, 0x9b, 0x68, 0x3b, 0x74, 0x6a, 0x05, 0xb3, 0x7d, 0x56, 0xce, 0x61, 0xca, 0xe8, + 0x50, 0x47, 0x0a, 0xc9, 0x5c, 0x24, 0xf3, 0xfe, 0x5f, 0x3e, 0x42, 0xa5, 0x9c, 0xa3, 0xaf, 0x4d, + 0xe7, 0x03, 0x1a, 0xcb, 0x11, 0x03, 0xbe, 0x6d, 0x74, 0xca, 0xb8, 0x1a, 0xa5, 0xee, 0xb4, 0xbd, + 0xca, 0x7c, 0x7d, 0x80, 0x97, 0x3d, 0x5d, 0xdc, 0xc0, 0x85, 0xa6, 0xed, 0xc1, 0x16, 0x0b, 0xc8, + 0x23, 0x9b, 0xfe, 0xb4, 0xa6, 0xf8, 0x1e, 0x9d, 0x3e, 0x3f, 0x35, 0xab, 0xd7, 0x49, 0x3e, 0xf5, + 0xe1, 0x27, 0x00, 0x00, 0xff, 0xff, 0x72, 0x2d, 0x47, 0x30, 0x88, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto new file mode 100644 index 0000000000..0c46d9547a --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/api/serviceconfig/usage.proto @@ -0,0 +1,74 @@ +// 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. + +syntax = "proto3"; + +package google.api; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "UsageProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + + +// Configuration controlling usage of a service. +message Usage { + // 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'. + repeated string requirements = 1; + + // A list of usage rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated UsageRule rules = 6; +} + +// 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 +message UsageRule { + // 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. + string selector = 1; + + // True, if the method allows unregistered calls; false otherwise. + bool allow_unregistered_calls = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go new file mode 100644 index 0000000000..eab8232cb9 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.pb.go @@ -0,0 +1,134 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/type/http_request.proto +// DO NOT EDIT! + +/* +Package google_logging_type is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/logging/type/http_request.proto + google.golang.org/genproto/googleapis/logging/type/log_severity.proto + +It has these top-level messages: + HttpRequest +*/ +package google_logging_type // import "google.golang.org/genproto/googleapis/logging/type" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +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"` +} + +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) GetLatency() *google_protobuf1.Duration { + if m != nil { + return m.Latency + } + return nil +} + +func init() { + proto.RegisterType((*HttpRequest)(nil), "google.logging.type.HttpRequest") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/logging/type/http_request.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 477 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0x6f, 0x13, 0x31, + 0x10, 0xc5, 0x15, 0xda, 0xe6, 0x8f, 0x37, 0x8d, 0x2a, 0x23, 0x81, 0x29, 0xe2, 0x5f, 0x11, 0x52, + 0x2f, 0xac, 0x25, 0x7a, 0xe2, 0x48, 0x04, 0xa8, 0x45, 0x20, 0xaa, 0xad, 0x80, 0xe3, 0x6a, 0xb3, + 0x71, 0xbc, 0x16, 0xce, 0xda, 0xd8, 0xde, 0xa0, 0xf0, 0x35, 0xf8, 0xc2, 0x8c, 0xc7, 0xbb, 0x88, + 0x03, 0x87, 0x5e, 0xa2, 0xec, 0xef, 0xbd, 0x37, 0x1e, 0x8f, 0x87, 0xbc, 0x93, 0xc6, 0x48, 0x2d, + 0x72, 0x69, 0x74, 0xd5, 0xca, 0xdc, 0x38, 0xc9, 0xa5, 0x68, 0xad, 0x33, 0xc1, 0xf0, 0x24, 0x55, + 0x56, 0x79, 0xae, 0x8d, 0x94, 0xaa, 0x95, 0x3c, 0xec, 0xad, 0xe0, 0x4d, 0x08, 0xb6, 0x74, 0xe2, + 0x47, 0x27, 0x7c, 0xc8, 0xd1, 0x4a, 0xef, 0xf6, 0x65, 0x7a, 0x5f, 0x1e, 0x7d, 0xa7, 0x57, 0xb7, + 0xab, 0x0d, 0x3f, 0xdc, 0x0b, 0xb7, 0x53, 0xb5, 0xa8, 0x4d, 0xbb, 0x51, 0x92, 0x57, 0x6d, 0x6b, + 0x42, 0x15, 0x94, 0x69, 0x7d, 0xaa, 0x7f, 0xfa, 0x5a, 0xaa, 0xd0, 0x74, 0xab, 0xbc, 0x36, 0x5b, + 0x9e, 0xca, 0x71, 0x14, 0x56, 0xdd, 0x86, 0xdb, 0x78, 0x98, 0xe7, 0xeb, 0xce, 0x61, 0xe4, 0xef, + 0x9f, 0x14, 0x3d, 0xfb, 0x7d, 0x48, 0xb2, 0x4b, 0xe8, 0xb8, 0x48, 0x0d, 0xd3, 0x17, 0x64, 0xd1, + 0xf7, 0x5e, 0x6e, 0x45, 0x68, 0xcc, 0x9a, 0x8d, 0x9e, 0x8e, 0xce, 0x67, 0xc5, 0x71, 0x4f, 0x3f, + 0x21, 0xa4, 0x4f, 0x48, 0x36, 0xd8, 0x3a, 0xa7, 0xd9, 0x1d, 0xf4, 0x90, 0x1e, 0x7d, 0x71, 0x9a, + 0x3e, 0x23, 0xf3, 0xc1, 0xe0, 0xd5, 0x2f, 0xc1, 0x0e, 0xc0, 0x71, 0x50, 0x0c, 0xa1, 0x1b, 0x40, + 0xf4, 0x1e, 0x19, 0x7b, 0xb8, 0x47, 0xe7, 0xd9, 0x21, 0x88, 0x47, 0x45, 0xff, 0x45, 0x9f, 0x13, + 0x38, 0xcc, 0x5b, 0xb8, 0x9e, 0x48, 0xd9, 0x23, 0xcc, 0xce, 0x07, 0x88, 0xe1, 0x47, 0x84, 0x74, + 0x30, 0x96, 0xb2, 0x82, 0x99, 0x05, 0x36, 0xc6, 0xf3, 0x67, 0x91, 0xbc, 0x89, 0x80, 0x3e, 0x24, + 0x33, 0x27, 0xb6, 0x26, 0x88, 0x52, 0x59, 0x36, 0x41, 0x75, 0x9a, 0xc0, 0x95, 0x8d, 0x62, 0x9c, + 0x28, 0xa4, 0x41, 0x3c, 0x4e, 0x62, 0x02, 0x20, 0x32, 0x32, 0x71, 0x62, 0x23, 0x9c, 0x70, 0x6c, + 0x8a, 0xd2, 0xf0, 0x49, 0x2f, 0xc8, 0x44, 0x57, 0x41, 0xb4, 0xf5, 0x9e, 0x2d, 0x40, 0xc9, 0x5e, + 0x3d, 0xc8, 0xfb, 0x27, 0x1c, 0x86, 0x9d, 0xbf, 0xed, 0x87, 0x5b, 0x0c, 0xce, 0x38, 0x87, 0xba, + 0xaa, 0x1b, 0x51, 0x6a, 0x63, 0xbe, 0x77, 0x96, 0x65, 0x90, 0x9c, 0x16, 0x19, 0xb2, 0x8f, 0x88, + 0x62, 0x3b, 0xc9, 0xd2, 0xa8, 0xc0, 0x66, 0xa8, 0x4f, 0x11, 0x5c, 0xaa, 0x40, 0x3f, 0x90, 0xb3, + 0x24, 0xee, 0x2a, 0xad, 0xd6, 0x50, 0x74, 0x5d, 0xfe, 0x84, 0xc7, 0x2e, 0x8d, 0x53, 0xb0, 0x4a, + 0x65, 0x6a, 0x9b, 0x11, 0x4c, 0x3d, 0x46, 0xe7, 0xd7, 0xc1, 0xf8, 0x0d, 0x7c, 0x9f, 0xd1, 0x76, + 0x83, 0x2e, 0x7a, 0x4e, 0x4e, 0x52, 0xad, 0x8d, 0xd2, 0xba, 0x5c, 0xed, 0x83, 0xf0, 0x6c, 0x8e, + 0xb3, 0x5d, 0x20, 0x7f, 0x0f, 0x78, 0x19, 0xe9, 0xf2, 0x25, 0xb9, 0x0f, 0xbb, 0x94, 0xff, 0x67, + 0x6d, 0x97, 0x27, 0xff, 0x6c, 0xcb, 0x75, 0xbc, 0xf7, 0xf5, 0x68, 0x35, 0xc6, 0x01, 0x5c, 0xfc, + 0x09, 0x00, 0x00, 0xff, 0xff, 0x4b, 0x1c, 0x8f, 0x8c, 0x2f, 0x03, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.proto new file mode 100644 index 0000000000..34345b7a7d --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/http_request.proto @@ -0,0 +1,86 @@ +// 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. + +syntax = "proto3"; + +package google.logging.type; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "github.com/golang/protobuf/ptypes/duration/duration.proto"; // from google/protobuf/duration.proto + +option java_multiple_files = true; +option java_outer_classname = "HttpRequestProto"; +option java_package = "com.google.logging.type"; + + +// 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. +message HttpRequest { + // The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`. + string request_method = 1; + + // 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"`. + string request_url = 2; + + // The size of the HTTP request message in bytes, including the request + // headers and the request body. + int64 request_size = 3; + + // The response code indicating the status of response. + // Examples: 200, 404. + int32 status = 4; + + // The size of the HTTP response message sent back to the client, in bytes, + // including the response headers and the response body. + int64 response_size = 5; + + // The user agent sent by the client. Example: + // `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`. + string user_agent = 6; + + // The IP address (IPv4 or IPv6) of the client that issued the HTTP + // request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`. + string remote_ip = 7; + + // The IP address (IPv4 or IPv6) of the origin server that the request was + // sent to. + string server_ip = 13; + + // The referer URL of the request, as defined in + // [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + string referer = 8; + + // The request processing latency on the server, from the time the request was + // received until the response was sent. + google.protobuf.Duration latency = 14; + + // Whether or not a cache lookup was attempted. + bool cache_lookup = 11; + + // Whether or not an entity was served from cache + // (with or without validation). + bool cache_hit = 9; + + // 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. + bool cache_validated_with_origin_server = 10; + + // The number of HTTP response bytes inserted into cache. Set only when a + // cache fill was attempted. + int64 cache_fill_bytes = 12; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go new file mode 100644 index 0000000000..47f1219939 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.pb.go @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/type/log_severity.proto +// DO NOT EDIT! + +package google_logging_type // import "google.golang.org/genproto/googleapis/logging/type" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" + +// 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.golang.org/genproto/googleapis/logging/type/log_severity.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 278 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x72, 0x4d, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x87, 0x48, 0x25, 0x16, 0x64, 0x16, 0xeb, 0xe7, 0xe4, + 0xa7, 0xa7, 0x67, 0xe6, 0xa5, 0xeb, 0x97, 0x54, 0x16, 0xa4, 0x82, 0x38, 0xf1, 0xc5, 0xa9, 0x65, + 0xa9, 0x45, 0x99, 0x25, 0x95, 0x7a, 0x60, 0xa5, 0x42, 0xc2, 0x50, 0x63, 0xa0, 0xea, 0xf4, 0x40, + 0xea, 0xa4, 0x3c, 0x89, 0x33, 0x1b, 0x48, 0xe8, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x26, + 0xe7, 0xe7, 0xa5, 0x65, 0xa6, 0xeb, 0x27, 0xe6, 0xe5, 0xe5, 0x97, 0x24, 0x96, 0x64, 0xe6, 0xe7, + 0x15, 0x43, 0xcc, 0xd7, 0x6a, 0x62, 0xe4, 0xe2, 0xf6, 0xc9, 0x4f, 0x0f, 0x86, 0xda, 0x2a, 0xc4, + 0xcd, 0xc5, 0xee, 0xe2, 0xea, 0xe6, 0x18, 0xea, 0x13, 0x22, 0xc0, 0x20, 0xc4, 0xc9, 0xc5, 0xea, + 0xe2, 0xea, 0x14, 0xea, 0x2e, 0x90, 0x02, 0x64, 0xb2, 0x78, 0xfa, 0xb9, 0xf9, 0x0b, 0x9c, 0x60, + 0x04, 0x2a, 0x61, 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, 0x27, 0x50, 0x9d, + 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, + 0xba, 0x5c, 0xe2, 0xc9, 0xf9, 0xb9, 0x7a, 0x58, 0xbc, 0xea, 0x24, 0x80, 0xe4, 0xb8, 0x00, 0x90, + 0x8b, 0x03, 0x18, 0x93, 0xd8, 0xc0, 0x4e, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x01, 0xa8, + 0xad, 0x71, 0x63, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.proto new file mode 100644 index 0000000000..bcb451ac39 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/type/log_severity.proto @@ -0,0 +1,69 @@ +// 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. + +syntax = "proto3"; + +package google.logging.type; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto + +option java_multiple_files = true; +option java_outer_classname = "LogSeverityProto"; +option java_package = "com.google.logging.type"; + + +// 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. +enum LogSeverity { + // (0) The log entry has no assigned severity level. + DEFAULT = 0; + + // (100) Debug or trace information. + DEBUG = 100; + + // (200) Routine information, such as ongoing status or performance. + INFO = 200; + + // (300) Normal but significant events, such as start up, shut down, or + // a configuration change. + NOTICE = 300; + + // (400) Warning events might cause problems. + WARNING = 400; + + // (500) Error events are likely to cause problems. + ERROR = 500; + + // (600) Critical events cause more severe problems or outages. + CRITICAL = 600; + + // (700) A person must take an action immediately. + ALERT = 700; + + // (800) One or more systems are unusable. + EMERGENCY = 800; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go new file mode 100644 index 0000000000..c2e9852b28 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.pb.go @@ -0,0 +1,358 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/v2/log_entry.proto +// DO NOT EDIT! + +/* +Package v2 is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/logging/v2/log_entry.proto + google.golang.org/genproto/googleapis/logging/v2/logging.proto + google.golang.org/genproto/googleapis/logging/v2/logging_config.proto + google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto + +It has these top-level messages: + LogEntry + LogEntryOperation + DeleteLogRequest + WriteLogEntriesRequest + WriteLogEntriesResponse + ListLogEntriesRequest + ListLogEntriesResponse + ListMonitoredResourceDescriptorsRequest + ListMonitoredResourceDescriptorsResponse + LogSink + ListSinksRequest + ListSinksResponse + GetSinkRequest + CreateSinkRequest + UpdateSinkRequest + DeleteSinkRequest + LogMetric + ListLogMetricsRequest + ListLogMetricsResponse + GetLogMetricRequest + CreateLogMetricRequest + UpdateLogMetricRequest + DeleteLogMetricRequest +*/ +package v2 // import "google.golang.org/genproto/googleapis/logging/v2" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +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. The format of the name is + // `"projects//logs/"`. Examples: + // `"projects/my-projectid/logs/syslog"`, + // `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`. + // + // The log ID part of resource name must be less than 512 characters + // long and can only include the following characters: upper and + // lower case alphanumeric characters: [A-Za-z0-9]; and punctuation + // characters: forward-slash, underscore, hyphen, and period. + // Forward-slash (`/`) characters in the log ID must be URL-encoded. + 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. If + // omitted, Stackdriver Logging will use the time the log entry is received. + Timestamp *google_protobuf4.Timestamp `protobuf:"bytes,9,opt,name=timestamp" json:"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 ID for the log entry. If you provide this + // field, the logging service considers other log entries in the + // same project with the same ID as duplicates which can be removed. If + // omitted, Stackdriver Logging will generate a unique ID for this + // log entry. + 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"` +} + +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) 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) 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 +} + +// 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 init() { + proto.RegisterType((*LogEntry)(nil), "google.logging.v2.LogEntry") + proto.RegisterType((*LogEntryOperation)(nil), "google.logging.v2.LogEntryOperation") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/logging/v2/log_entry.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 617 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0x5f, 0x6f, 0xd3, 0x3e, + 0x14, 0xfd, 0x65, 0xff, 0x9a, 0xb8, 0xdd, 0x7e, 0xcc, 0x1a, 0x22, 0x04, 0x21, 0x55, 0x03, 0x09, + 0x9e, 0x1c, 0x54, 0x84, 0xb4, 0x31, 0x24, 0xa0, 0x68, 0xd2, 0x26, 0x0d, 0x36, 0x79, 0x3c, 0x21, + 0xa1, 0x2a, 0x4d, 0x5d, 0xd7, 0x90, 0xda, 0xc1, 0x71, 0x2a, 0xf2, 0x81, 0xf8, 0x8e, 0x3c, 0x62, + 0x3b, 0x4e, 0x3a, 0x51, 0xc4, 0x36, 0xf1, 0xd0, 0xf6, 0x5e, 0xfb, 0x9c, 0x73, 0x7d, 0xcf, 0xb5, + 0x0b, 0xde, 0x50, 0x21, 0x68, 0x46, 0x10, 0x15, 0x59, 0xc2, 0x29, 0x12, 0x92, 0xc6, 0x94, 0xf0, + 0x5c, 0x0a, 0x25, 0xe2, 0x7a, 0x2b, 0xc9, 0x59, 0x11, 0x67, 0x82, 0x52, 0xc6, 0x69, 0xbc, 0x18, + 0x98, 0x70, 0x44, 0xb8, 0x92, 0x15, 0xb2, 0x28, 0xb8, 0xeb, 0x14, 0x1c, 0x04, 0x2d, 0x06, 0xd1, + 0xe9, 0xcd, 0x44, 0xf5, 0x57, 0x5c, 0x10, 0xb9, 0x60, 0x29, 0x49, 0x05, 0x9f, 0x32, 0x1a, 0x27, + 0x9c, 0x0b, 0x95, 0x28, 0x26, 0x78, 0x51, 0xab, 0x47, 0xe7, 0x37, 0x97, 0x9a, 0x0b, 0xce, 0x94, + 0x90, 0x64, 0x22, 0x49, 0xb1, 0x4c, 0x46, 0x3a, 0x13, 0xa5, 0x4c, 0x89, 0x13, 0x3c, 0xbe, 0x5d, + 0xc3, 0xaa, 0xca, 0x49, 0x3c, 0x53, 0x2a, 0xd7, 0x3a, 0xdf, 0x4a, 0x52, 0xa8, 0x7f, 0x90, 0x31, + 0xce, 0x15, 0x64, 0x41, 0x24, 0x53, 0xce, 0xbc, 0x28, 0xa6, 0x4c, 0xcd, 0xca, 0x31, 0x4a, 0xc5, + 0x3c, 0xae, 0xa5, 0x62, 0xbb, 0x31, 0x2e, 0xa7, 0x71, 0x6e, 0x48, 0xba, 0x35, 0x5e, 0x99, 0x8f, + 0x23, 0xbc, 0xb8, 0x9e, 0x50, 0x28, 0x59, 0xa6, 0xca, 0xfd, 0x38, 0xda, 0xd1, 0xf5, 0x34, 0xc5, + 0xe6, 0xba, 0xbd, 0x64, 0x9e, 0x2f, 0xa3, 0x9a, 0xbc, 0xff, 0x63, 0x13, 0xf8, 0x67, 0x82, 0x1e, + 0x9b, 0xa1, 0xc3, 0xfb, 0xc0, 0x37, 0x7d, 0xf0, 0x64, 0x4e, 0xc2, 0x5e, 0xdf, 0x7b, 0x1a, 0xe0, + 0x8e, 0xce, 0x3f, 0xe8, 0x14, 0x1e, 0x02, 0xbf, 0x31, 0x3b, 0xf4, 0xf5, 0x56, 0x77, 0xf0, 0x10, + 0x39, 0x9b, 0xb4, 0x19, 0xe8, 0x7d, 0x33, 0x12, 0xec, 0x40, 0xb8, 0x85, 0xc3, 0x23, 0xb0, 0x6d, + 0x6b, 0x8d, 0xf2, 0xa4, 0xca, 0x44, 0x32, 0x09, 0xd7, 0x2c, 0x7f, 0xaf, 0xe1, 0x37, 0x87, 0x45, + 0x6f, 0x79, 0x75, 0xf2, 0x1f, 0xee, 0xd9, 0xfc, 0xa2, 0xc6, 0xc2, 0x47, 0xa0, 0xa7, 0xc8, 0x77, + 0xd5, 0x72, 0xd7, 0xcd, 0xb1, 0x34, 0xaa, 0x6b, 0x56, 0x1b, 0xd0, 0x2b, 0xd0, 0xfb, 0x52, 0x08, + 0xde, 0x82, 0xb6, 0x6c, 0x81, 0x7b, 0x2b, 0x05, 0x2e, 0xad, 0x6d, 0x86, 0x6d, 0xe0, 0x0d, 0xfb, + 0x00, 0x04, 0xad, 0x2b, 0x61, 0x60, 0xa9, 0xd1, 0x0a, 0xf5, 0x63, 0x83, 0xc0, 0x4b, 0xb0, 0xae, + 0xeb, 0x37, 0x33, 0x0f, 0x81, 0x26, 0xee, 0x0c, 0xfa, 0xe8, 0xb7, 0x17, 0x63, 0xfc, 0x47, 0xda, + 0xe0, 0x4b, 0x87, 0xc3, 0x2d, 0x03, 0x3e, 0x00, 0x01, 0xe3, 0xfa, 0x8d, 0xa8, 0x11, 0x9b, 0x84, + 0x1b, 0xd6, 0x6e, 0xbf, 0x5e, 0x38, 0x9d, 0xc0, 0x77, 0xa0, 0x77, 0xf5, 0x66, 0x86, 0x1d, 0x7b, + 0xae, 0x3f, 0xcb, 0x9f, 0x68, 0x20, 0xae, 0x71, 0xb8, 0x3b, 0x5b, 0x26, 0xf0, 0x35, 0xd8, 0xca, + 0x92, 0x31, 0xc9, 0x8a, 0xb0, 0xdb, 0x5f, 0xd7, 0xf4, 0x27, 0x68, 0xe5, 0x3d, 0xa3, 0x66, 0xf8, + 0xe8, 0xcc, 0x22, 0x6d, 0x8c, 0x1d, 0x0d, 0x0e, 0x41, 0x20, 0x72, 0x22, 0xed, 0xab, 0x0d, 0xff, + 0xb7, 0x47, 0x78, 0xfc, 0x17, 0x8d, 0xf3, 0x06, 0x8b, 0x97, 0xb4, 0xe8, 0x10, 0x74, 0xaf, 0x48, + 0xc3, 0x3b, 0x60, 0xfd, 0x2b, 0xa9, 0x42, 0xcf, 0xf6, 0x6b, 0x42, 0xb8, 0x07, 0x36, 0x17, 0x49, + 0x56, 0x12, 0x7b, 0x2f, 0x02, 0x5c, 0x27, 0x2f, 0xd7, 0x0e, 0xbc, 0x61, 0x00, 0x3a, 0x6e, 0xa4, + 0xfb, 0x0c, 0xec, 0xae, 0x54, 0x81, 0x3b, 0x60, 0x4d, 0x5b, 0x57, 0x4b, 0xe9, 0x08, 0x46, 0xc0, + 0xd7, 0x03, 0x9b, 0x94, 0x29, 0x91, 0x4e, 0xac, 0xcd, 0x4d, 0x95, 0x29, 0x93, 0xda, 0x49, 0x73, + 0x83, 0x7c, 0x5c, 0x27, 0x10, 0x82, 0x8d, 0x2c, 0xd1, 0x8b, 0x1b, 0x76, 0xd1, 0xc6, 0xc3, 0xcf, + 0xe0, 0xae, 0x7e, 0x4a, 0xab, 0x6d, 0x0e, 0xb7, 0x9b, 0x13, 0x5c, 0xd8, 0x1b, 0xea, 0x7d, 0x7a, + 0x76, 0xdb, 0x3f, 0xd8, 0x9f, 0x9e, 0x37, 0xde, 0xb2, 0xfb, 0xcf, 0x7f, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x1e, 0x4b, 0x59, 0x17, 0x9e, 0x05, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.proto new file mode 100644 index 0000000000..709a98fdfa --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/log_entry.proto @@ -0,0 +1,115 @@ +// 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. + +syntax = "proto3"; + +package google.logging.v2; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto"; // from google/api/monitored_resource.proto +import "google.golang.org/genproto/googleapis/logging/type/http_request.proto"; // from google/logging/type/http_request.proto +import "google.golang.org/genproto/googleapis/logging/type/log_severity.proto"; // from google/logging/type/log_severity.proto +import "github.com/golang/protobuf/ptypes/any/any.proto"; // from google/protobuf/any.proto +import "github.com/golang/protobuf/ptypes/struct/struct.proto"; // from google/protobuf/struct.proto +import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto"; // from google/protobuf/timestamp.proto + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_outer_classname = "LogEntryProto"; +option java_package = "com.google.logging.v2"; + +option go_package = "google.golang.org/genproto/googleapis/logging/v2"; + +// An individual entry in a log. +message LogEntry { + // Required. The resource name of the log to which this log entry + // belongs. The format of the name is + // `"projects//logs/"`. Examples: + // `"projects/my-projectid/logs/syslog"`, + // `"projects/my-projectid/logs/library.googleapis.com%2Fbook_log"`. + // + // The log ID part of resource name must be less than 512 characters + // long and can only include the following characters: upper and + // lower case alphanumeric characters: [A-Za-z0-9]; and punctuation + // characters: forward-slash, underscore, hyphen, and period. + // Forward-slash (`/`) characters in the log ID must be URL-encoded. + string log_name = 12; + + // 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. + google.api.MonitoredResource resource = 8; + + // Optional. The log entry payload, which can be one of multiple types. + oneof payload { + // The log entry payload, represented as a protocol buffer. Some + // Google Cloud Platform services use this field for their log + // entry payloads. + google.protobuf.Any proto_payload = 2; + + // The log entry payload, represented as a Unicode string (UTF-8). + string text_payload = 3; + + // The log entry payload, represented as a structure that + // is expressed as a JSON object. + google.protobuf.Struct json_payload = 6; + } + + // Optional. The time the event described by the log entry occurred. If + // omitted, Stackdriver Logging will use the time the log entry is received. + google.protobuf.Timestamp timestamp = 9; + + // Optional. The severity of the log entry. The default value is + // `LogSeverity.DEFAULT`. + google.logging.type.LogSeverity severity = 10; + + // Optional. A unique ID for the log entry. If you provide this + // field, the logging service considers other log entries in the + // same project with the same ID as duplicates which can be removed. If + // omitted, Stackdriver Logging will generate a unique ID for this + // log entry. + string insert_id = 4; + + // Optional. Information about the HTTP request associated with this + // log entry, if applicable. + google.logging.type.HttpRequest http_request = 7; + + // Optional. A set of user-defined (key, value) data that provides additional + // information about the log entry. + map labels = 11; + + // Optional. Information about an operation associated with the log entry, if + // applicable. + LogEntryOperation operation = 15; +} + +// Additional information about a potentially long-running operation with which +// a log entry is associated. +message LogEntryOperation { + // Optional. An arbitrary operation identifier. Log entries with the + // same identifier are assumed to be part of the same operation. + string id = 1; + + // 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"`. + string producer = 2; + + // Optional. Set this to True if this is the first log entry in the operation. + bool first = 3; + + // Optional. Set this to True if this is the last log entry in the operation. + bool last = 4; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go new file mode 100644 index 0000000000..198dc898c6 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.pb.go @@ -0,0 +1,479 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/v2/logging.proto +// DO NOT EDIT! + +package v2 // import "google.golang.org/genproto/googleapis/logging/v2" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +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.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. Example: + // `"projects/my-project/logs/syslog"`. + 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} } + +// 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`. Example: + // `"projects/my-project/logs/syslog"`. 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 write. Values supplied for the fields + // `log_name`, `resource`, and `labels` in this `entries.write` request are + // added to those log entries that do not provide their own values for the + // fields. + // + // To improve throughput and to avoid exceeding the + // [quota limit](/logging/quota-policy) for calls to `entries.write`, + // you should write multiple log entries at once 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, the response status will be the error associated + // with one of the failed entries and include error details in the form of + // WriteLogEntriesPartialErrors. + 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) 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 +} + +// 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} } + +// The parameters to `ListLogEntries`. +type ListLogEntriesRequest struct { + // Deprecated. One or more project identifiers or project numbers from which + // to retrieve log entries. Examples: `"my-project-1A"`, `"1234567890"`. If + // present, these project identifiers are converted to resource format and + // added to the list of resources in `resourceNames`. Callers should use + // `resourceNames` rather than this parameter. + ProjectIds []string `protobuf:"bytes,1,rep,name=project_ids,json=projectIds" json:"project_ids,omitempty"` + // Optional. One or more cloud resources from which to retrieve log entries. + // Example: `"projects/my-project-1A"`, `"projects/1234567890"`. Projects + // listed in `projectIds` 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. + 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 `LogEntry.insertId`. + 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 `nextPageToken` 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. `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,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{3} } + +// Result returned from `ListLogEntries`. +type ListLogEntriesResponse struct { + // A list of log entries. + Entries []*LogEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,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 *ListLogEntriesResponse) Reset() { *m = ListLogEntriesResponse{} } +func (m *ListLogEntriesResponse) String() string { return proto.CompactTextString(m) } +func (*ListLogEntriesResponse) ProtoMessage() {} +func (*ListLogEntriesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *ListLogEntriesResponse) GetEntries() []*LogEntry { + if m != nil { + return m.Entries + } + return nil +} + +// 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{5} +} + +// 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 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 *ListMonitoredResourceDescriptorsResponse) Reset() { + *m = ListMonitoredResourceDescriptorsResponse{} +} +func (m *ListMonitoredResourceDescriptorsResponse) String() string { return proto.CompactTextString(m) } +func (*ListMonitoredResourceDescriptorsResponse) ProtoMessage() {} +func (*ListMonitoredResourceDescriptorsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{6} +} + +func (m *ListMonitoredResourceDescriptorsResponse) GetResourceDescriptors() []*google_api3.MonitoredResourceDescriptor { + if m != nil { + return m.ResourceDescriptors + } + return nil +} + +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((*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") +} + +// 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 LoggingServiceV2 service + +type LoggingServiceV2Client interface { + // Deletes a log and all its log entries. + // The log will reappear if it receives new entries. + DeleteLog(ctx context.Context, in *DeleteLogRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) + // Writes log entries to Stackdriver Logging. All log entries are + // written by this method. + WriteLogEntries(ctx context.Context, in *WriteLogEntriesRequest, opts ...grpc.CallOption) (*WriteLogEntriesResponse, error) + // Lists log entries. Use this method to retrieve log entries from Cloud + // 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 monitored resource descriptors used by Stackdriver Logging. + ListMonitoredResourceDescriptors(ctx context.Context, in *ListMonitoredResourceDescriptorsRequest, opts ...grpc.CallOption) (*ListMonitoredResourceDescriptorsResponse, 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 +} + +// Server API for LoggingServiceV2 service + +type LoggingServiceV2Server interface { + // Deletes a log and all its log entries. + // The log will reappear if it receives new entries. + DeleteLog(context.Context, *DeleteLogRequest) (*google_protobuf5.Empty, error) + // Writes log entries to Stackdriver Logging. All log entries are + // written by this method. + WriteLogEntries(context.Context, *WriteLogEntriesRequest) (*WriteLogEntriesResponse, error) + // Lists log entries. Use this method to retrieve log entries from Cloud + // Logging. For ways to export log entries, see + // [Exporting Logs](/logging/docs/export). + ListLogEntries(context.Context, *ListLogEntriesRequest) (*ListLogEntriesResponse, error) + // Lists the monitored resource descriptors used by Stackdriver Logging. + ListMonitoredResourceDescriptors(context.Context, *ListMonitoredResourceDescriptorsRequest) (*ListMonitoredResourceDescriptorsResponse, 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) +} + +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, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: fileDescriptor1, +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/logging/v2/logging.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x6f, 0xeb, 0x44, + 0x10, 0x96, 0x93, 0xd7, 0xbe, 0x64, 0xcb, 0x6b, 0xf3, 0x96, 0xd7, 0x90, 0x97, 0xf2, 0x44, 0x64, + 0x54, 0x92, 0x46, 0xaa, 0x0d, 0xa9, 0x2a, 0xd1, 0x54, 0x45, 0xa8, 0x6a, 0x0f, 0x95, 0x52, 0xa8, + 0x5c, 0x04, 0x52, 0x85, 0x14, 0x39, 0xce, 0xd6, 0x2c, 0x75, 0xbc, 0x66, 0x77, 0x9d, 0x12, 0x10, + 0x97, 0x1e, 0xf8, 0x03, 0xfc, 0x0f, 0xfe, 0x05, 0x57, 0x2e, 0x5c, 0xb8, 0x22, 0xf1, 0x23, 0x38, + 0xb2, 0xbb, 0x5e, 0x27, 0x69, 0x92, 0xd7, 0xb8, 0xbd, 0x24, 0x3b, 0xb3, 0x33, 0xdf, 0xcc, 0x37, + 0x33, 0x3b, 0x06, 0x9f, 0xf9, 0x84, 0xf8, 0x01, 0xb2, 0x7c, 0x12, 0xb8, 0xa1, 0x6f, 0x11, 0xea, + 0xdb, 0x3e, 0x0a, 0x23, 0x4a, 0x38, 0xb1, 0x93, 0x2b, 0x37, 0xc2, 0xcc, 0x0e, 0x88, 0xef, 0xe3, + 0xd0, 0xb7, 0x87, 0xad, 0xf4, 0x68, 0x29, 0x1b, 0xf8, 0x52, 0xfb, 0xa7, 0xda, 0x61, 0xab, 0x7a, + 0x96, 0x0d, 0x52, 0xfc, 0xd8, 0x0c, 0xd1, 0x21, 0xf6, 0x90, 0x47, 0xc2, 0x6b, 0xec, 0xdb, 0x6e, + 0x18, 0x12, 0xee, 0x72, 0x4c, 0x42, 0x96, 0xa0, 0x57, 0xbf, 0xcc, 0x0e, 0x35, 0x20, 0x21, 0xe6, + 0x84, 0xa2, 0x3e, 0x45, 0x6c, 0x22, 0x74, 0x85, 0x44, 0x62, 0xea, 0x21, 0x0d, 0xf8, 0xf9, 0x53, + 0xe8, 0x76, 0x51, 0xc8, 0xe9, 0x48, 0x23, 0x1c, 0xf8, 0x98, 0x7f, 0x17, 0xf7, 0x2c, 0x8f, 0x0c, + 0xec, 0x04, 0xc5, 0x56, 0x17, 0xbd, 0xf8, 0xda, 0x8e, 0xf8, 0x28, 0x12, 0xd1, 0xfb, 0x31, 0x55, + 0x2c, 0xc6, 0x07, 0xed, 0xba, 0xb7, 0xdc, 0x15, 0x0d, 0xc4, 0x21, 0xf9, 0xd5, 0x4e, 0x87, 0xcb, + 0x9d, 0x38, 0x1e, 0x20, 0xc6, 0xdd, 0x41, 0x34, 0x39, 0x69, 0xe7, 0xa3, 0x6c, 0x74, 0x69, 0xe4, + 0xd9, 0xc2, 0x8d, 0xc7, 0x4c, 0xff, 0x25, 0xee, 0xe6, 0x2e, 0x28, 0x9d, 0xa0, 0x00, 0x71, 0xd4, + 0x21, 0xbe, 0x83, 0x7e, 0x88, 0x05, 0x36, 0x7c, 0x0d, 0x0a, 0xb2, 0x24, 0xa1, 0x3b, 0x40, 0x15, + 0xa3, 0x66, 0x34, 0x8a, 0xce, 0x73, 0x21, 0x7f, 0x21, 0x44, 0xf3, 0xef, 0x1c, 0x28, 0x7f, 0x43, + 0xb1, 0x32, 0x3f, 0x15, 0x25, 0xc3, 0x88, 0x2d, 0xf7, 0x82, 0x07, 0xa0, 0x90, 0x36, 0xa9, 0x92, + 0x13, 0x57, 0x6b, 0xad, 0x37, 0x96, 0x4e, 0x5b, 0x24, 0x67, 0x9d, 0xa7, 0xad, 0x74, 0xb4, 0x91, + 0x33, 0x36, 0x87, 0xe7, 0x60, 0x35, 0x70, 0x7b, 0x28, 0x60, 0x95, 0x7c, 0x2d, 0x2f, 0x1c, 0xf7, + 0xad, 0xb9, 0x69, 0xb4, 0x16, 0x27, 0x64, 0x75, 0x94, 0x9f, 0x54, 0x8e, 0x1c, 0x0d, 0x02, 0xf7, + 0xc1, 0x73, 0x94, 0x58, 0x55, 0x9e, 0x29, 0xbc, 0xad, 0x05, 0x78, 0x1a, 0x6a, 0xe4, 0xa4, 0xb6, + 0xb0, 0x0e, 0x36, 0x22, 0x97, 0x72, 0xec, 0x06, 0x5d, 0x16, 0x7b, 0x1e, 0x62, 0xac, 0xb2, 0x22, + 0x78, 0x14, 0x9c, 0x75, 0xad, 0xbe, 0x4c, 0xb4, 0xd5, 0x03, 0xb0, 0x36, 0x15, 0x16, 0x96, 0x40, + 0xfe, 0x06, 0x8d, 0x74, 0x39, 0xe4, 0x11, 0xbe, 0x02, 0x2b, 0x43, 0x37, 0x88, 0x93, 0x3a, 0x14, + 0x9d, 0x44, 0x68, 0xe7, 0x3e, 0x35, 0xcc, 0xd7, 0xe0, 0xbd, 0x39, 0x22, 0x2c, 0x12, 0x0f, 0x05, + 0x99, 0x7f, 0x1a, 0x60, 0xb3, 0x83, 0x19, 0x9f, 0x2f, 0xfa, 0x07, 0x60, 0x4d, 0xf4, 0xf1, 0x7b, + 0xe4, 0xf1, 0x2e, 0xee, 0x33, 0x11, 0x28, 0x2f, 0x40, 0x81, 0x56, 0x9d, 0xf5, 0x19, 0xdc, 0x06, + 0xeb, 0x69, 0x2d, 0x55, 0x6b, 0x58, 0xa5, 0xa0, 0x6c, 0x5e, 0xa4, 0x5a, 0xd9, 0x20, 0x06, 0xcb, + 0x60, 0xf5, 0x1a, 0x07, 0x1c, 0x51, 0x9d, 0x97, 0x96, 0x64, 0x53, 0x09, 0xed, 0x23, 0xda, 0xed, + 0x8d, 0x44, 0x03, 0x54, 0x53, 0x95, 0x7c, 0x3c, 0x82, 0x5b, 0xa0, 0x18, 0xb9, 0x3e, 0xea, 0x32, + 0xfc, 0x13, 0x12, 0xc5, 0x34, 0x1a, 0x2b, 0x4e, 0x41, 0x2a, 0x2e, 0x85, 0x0c, 0xdf, 0x00, 0xa0, + 0x2e, 0x39, 0xb9, 0x41, 0xa1, 0xaa, 0x55, 0xd1, 0x51, 0xe6, 0x5f, 0x49, 0x85, 0x79, 0x0b, 0xca, + 0xb3, 0x7c, 0x12, 0xaa, 0xd3, 0x0d, 0x32, 0x1e, 0xd1, 0xa0, 0x8f, 0xc0, 0x46, 0x88, 0x7e, 0xe4, + 0xdd, 0xa9, 0xa0, 0x09, 0x91, 0x17, 0x52, 0x7d, 0x31, 0x0e, 0x8c, 0x40, 0x5d, 0x06, 0x9e, 0x9b, + 0xb8, 0x13, 0xc4, 0x3c, 0x8a, 0x23, 0xa1, 0x1b, 0x97, 0xf6, 0x1e, 0x3f, 0xe3, 0x41, 0x7e, 0xb9, + 0x59, 0x7e, 0xbf, 0x1b, 0xa0, 0xb1, 0x3c, 0x8e, 0xa6, 0x7c, 0x05, 0x5e, 0x8d, 0x5b, 0xd4, 0x9f, + 0xdc, 0x6b, 0xfe, 0xf5, 0x07, 0x5f, 0xca, 0x04, 0xcf, 0x79, 0x97, 0xce, 0xc7, 0xc8, 0x5a, 0x97, + 0xd6, 0x3f, 0xcf, 0x40, 0xa9, 0x93, 0x14, 0xf8, 0x32, 0x59, 0xd8, 0x5f, 0xb7, 0xe0, 0x2d, 0x28, + 0x8e, 0x77, 0x03, 0xfc, 0x70, 0x41, 0x1f, 0x66, 0x37, 0x47, 0xb5, 0x9c, 0x1a, 0xa5, 0xfb, 0xcb, + 0x3a, 0x95, 0x7b, 0xce, 0xdc, 0xbd, 0xfb, 0xeb, 0xdf, 0xdf, 0x72, 0xf5, 0xe6, 0xb6, 0x58, 0xb7, + 0x3d, 0xc4, 0xdd, 0x4f, 0xec, 0x9f, 0xd3, 0x5d, 0x71, 0xa4, 0x87, 0x95, 0xd9, 0x4d, 0xb9, 0x88, + 0xc5, 0xdf, 0x2f, 0xf0, 0x57, 0x03, 0x6c, 0xcc, 0xbc, 0x05, 0xb8, 0x93, 0xf9, 0xe1, 0x57, 0x9b, + 0x59, 0x4c, 0xf5, 0xd3, 0x7a, 0x5f, 0x65, 0x56, 0x36, 0x5f, 0xca, 0x0f, 0x81, 0x9e, 0xa6, 0xf6, + 0xad, 0x34, 0x6e, 0x1b, 0x4d, 0x78, 0x67, 0x80, 0xf5, 0xfb, 0x83, 0x0a, 0x1b, 0x8b, 0xe6, 0x71, + 0xd1, 0xdb, 0xac, 0xee, 0x64, 0xb0, 0xd4, 0x59, 0x6c, 0xa9, 0x2c, 0x36, 0xcd, 0xd2, 0x74, 0x16, + 0x81, 0xb0, 0x95, 0x49, 0xfc, 0x61, 0x80, 0xda, 0xb2, 0x61, 0x82, 0xed, 0xb7, 0x04, 0xcb, 0x30, + 0xe9, 0xd5, 0xc3, 0x27, 0xf9, 0xea, 0xd4, 0x1b, 0x2a, 0x75, 0x13, 0xd6, 0x64, 0xea, 0x83, 0x07, + 0x3c, 0x8e, 0xbf, 0x05, 0x9b, 0xe2, 0x0b, 0x37, 0x1f, 0xeb, 0xf8, 0x1d, 0x3d, 0x79, 0x17, 0x72, + 0x68, 0x2e, 0x8c, 0xab, 0x8f, 0x1f, 0xfb, 0x05, 0xff, 0xcf, 0x30, 0x7a, 0xab, 0xea, 0x7e, 0xef, + 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x21, 0x93, 0x51, 0x60, 0xee, 0x08, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.proto new file mode 100644 index 0000000000..9258cf7a07 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging.proto @@ -0,0 +1,190 @@ +// 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. + +syntax = "proto3"; + +package google.logging.v2; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "google.golang.org/genproto/googleapis/api/monitoredres/monitored_resource.proto"; // from google/api/monitored_resource.proto +import "google.golang.org/genproto/googleapis/logging/v2/log_entry.proto"; // from google/logging/v2/log_entry.proto +import "github.com/golang/protobuf/ptypes/duration/duration.proto"; // from google/protobuf/duration.proto +import "github.com/golang/protobuf/ptypes/empty/empty.proto"; // from google/protobuf/empty.proto +import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto"; // from google/protobuf/timestamp.proto +import "google.golang.org/genproto/googleapis/rpc/status/status.proto"; // from google/rpc/status.proto + +option cc_enable_arenas = true; +option java_multiple_files = true; +option java_outer_classname = "LoggingProto"; +option java_package = "com.google.logging.v2"; + +option go_package = "google.golang.org/genproto/googleapis/logging/v2"; + +// Service for ingesting and querying logs. +service LoggingServiceV2 { + // Deletes a log and all its log entries. + // The log will reappear if it receives new entries. + rpc DeleteLog(DeleteLogRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2beta1/{log_name=projects/*/logs/*}" }; + } + + // Writes log entries to Stackdriver Logging. All log entries are + // written by this method. + rpc WriteLogEntries(WriteLogEntriesRequest) returns (WriteLogEntriesResponse) { + option (google.api.http) = { post: "/v2/entries:write" body: "*" }; + } + + // Lists log entries. Use this method to retrieve log entries from Cloud + // Logging. For ways to export log entries, see + // [Exporting Logs](/logging/docs/export). + rpc ListLogEntries(ListLogEntriesRequest) returns (ListLogEntriesResponse) { + option (google.api.http) = { post: "/v2/entries:list" body: "*" }; + } + + // Lists the monitored resource descriptors used by Stackdriver Logging. + rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse) { + option (google.api.http) = { get: "/v2/monitoredResourceDescriptors" }; + } +} + +// The parameters to DeleteLog. +message DeleteLogRequest { + // Required. The resource name of the log to delete. Example: + // `"projects/my-project/logs/syslog"`. + string log_name = 1; +} + +// The parameters to WriteLogEntries. +message WriteLogEntriesRequest { + // Optional. A default log resource name that is assigned to all log entries + // in `entries` that do not specify a value for `log_name`. Example: + // `"projects/my-project/logs/syslog"`. See + // [LogEntry][google.logging.v2.LogEntry]. + string log_name = 1; + + // 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]. + google.api.MonitoredResource resource = 2; + + // 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]. + map labels = 3; + + // Required. The log entries to write. Values supplied for the fields + // `log_name`, `resource`, and `labels` in this `entries.write` request are + // added to those log entries that do not provide their own values for the + // fields. + // + // To improve throughput and to avoid exceeding the + // [quota limit](/logging/quota-policy) for calls to `entries.write`, + // you should write multiple log entries at once rather than + // calling this method for each individual log entry. + repeated LogEntry entries = 4; + + // 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, the response status will be the error associated + // with one of the failed entries and include error details in the form of + // WriteLogEntriesPartialErrors. + bool partial_success = 5; +} + +// Result returned from WriteLogEntries. +// empty +message WriteLogEntriesResponse { + +} + +// The parameters to `ListLogEntries`. +message ListLogEntriesRequest { + // Deprecated. One or more project identifiers or project numbers from which + // to retrieve log entries. Examples: `"my-project-1A"`, `"1234567890"`. If + // present, these project identifiers are converted to resource format and + // added to the list of resources in `resourceNames`. Callers should use + // `resourceNames` rather than this parameter. + repeated string project_ids = 1; + + // Optional. One or more cloud resources from which to retrieve log entries. + // Example: `"projects/my-project-1A"`, `"projects/1234567890"`. Projects + // listed in `projectIds` are added to this list. + repeated string resource_names = 8; + + // 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. + string filter = 2; + + // 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 `LogEntry.insertId`. + string order_by = 3; + + // 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. + int32 page_size = 4; + + // 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. + string page_token = 5; +} + +// Result returned from `ListLogEntries`. +message ListLogEntriesResponse { + // A list of log entries. + repeated LogEntry entries = 1; + + // 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`. + string next_page_token = 2; +} + +// The parameters to ListMonitoredResourceDescriptors +message ListMonitoredResourceDescriptorsRequest { + // 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. + int32 page_size = 1; + + // 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. + string page_token = 2; +} + +// Result returned from ListMonitoredResourceDescriptors. +message ListMonitoredResourceDescriptorsResponse { + // A list of resource descriptors. + repeated google.api.MonitoredResourceDescriptor resource_descriptors = 1; + + // 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`. + string next_page_token = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go new file mode 100644 index 0000000000..293b143590 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.pb.go @@ -0,0 +1,494 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/v2/logging_config.proto +// DO NOT EDIT! + +package v2 // import "google.golang.org/genproto/googleapis/logging/v2" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +import google_protobuf5 "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 + +// Available log entry formats. Log entries can be written to Cloud +// Logging in either format and can be exported in either format. +// Version 2 is the preferred format. +type LogSink_VersionFormat int32 + +const ( + // An unspecified version format 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 outside Stackdriver Logging. +type LogSink struct { + // Required. The client-assigned sink identifier, unique within the + // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are + // limited to 1000 characters and can include only the following characters: + // `A-Z`, `a-z`, `0-9`, and the special characters `_-.`. The maximum length + // of the name is 100 characters. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Required. The export destination. See + // [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). + // Examples: + // + // "storage.googleapis.com/my-gcs-bucket" + // "bigquery.googleapis.com/projects/my-project-id/datasets/my-dataset" + // "pubsub.googleapis.com/projects/my-project/topics/my-topic" + Destination string `protobuf:"bytes,3,opt,name=destination" json:"destination,omitempty"` + // Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). + // Only log entries matching the filter are exported. The filter + // must be consistent with the log entry format specified by the + // `outputVersionFormat` parameter, regardless of the format of the + // log entry that was originally written to Stackdriver Logging. + // Example filter (V2 format): + // + // logName=projects/my-projectid/logs/syslog AND severity>=ERROR + Filter string `protobuf:"bytes,5,opt,name=filter" json:"filter,omitempty"` + // Optional. The log entry version to use for this sink's exported log + // entries. This version does not have to correspond to the version of the + // log entry that was written to Stackdriver Logging. If omitted, the + // v2 format is used. + 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. The iam identity to which the destination needs to grant write + // access. This may be a service account or a group. + // Examples (Do not assume these specific values): + // "serviceAccount:cloud-logs@system.gserviceaccount.com" + // "group:cloud-logs@google.com" + // + // For GCS destinations, the role "roles/owner" is required on the bucket + // For Cloud Pubsub destinations, the role "roles/pubsub.publisher" is + // required on the topic + // For BigQuery, the role "roles/editor" is required on the dataset + WriterIdentity string `protobuf:"bytes,8,opt,name=writer_identity,json=writerIdentity" json:"writer_identity,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} } + +// The parameters to `ListSinks`. +type ListSinksRequest struct { + // Required. The cloud resource containing the sinks. + // Example: `"projects/my-logging-project"`. + 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} } + +// 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 +} + +// The parameters to `GetSink`. +type GetSinkRequest struct { + // Required. The resource name of the sink to return. + // 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} } + +// The parameters to `CreateSink`. +type CreateSinkRequest struct { + // Required. The resource in which to create the sink. + // Example: `"projects/my-project-id"`. + // The new sink must be provided in the request. + 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"` +} + +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) GetSink() *LogSink { + if m != nil { + return m.Sink + } + return nil +} + +// The parameters to `UpdateSink`. +type UpdateSinkRequest struct { + // Required. The resource name of the sink to update, including the parent + // resource and the sink identifier. If the sink does not exist, this method + // creates the sink. 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 `sinkName`. If `sinkName` does not exist, then + // this method creates a new sink. + Sink *LogSink `protobuf:"bytes,2,opt,name=sink" json:"sink,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) GetSink() *LogSink { + if m != nil { + return m.Sink + } + return nil +} + +// The parameters to `DeleteSink`. +type DeleteSinkRequest struct { + // Required. The resource name of the sink to delete, including the parent + // resource and the sink identifier. Example: + // `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink + // does not exist. + 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 init() { + proto.RegisterType((*LogSink)(nil), "google.logging.v2.LogSink") + proto.RegisterType((*ListSinksRequest)(nil), "google.logging.v2.ListSinksRequest") + proto.RegisterType((*ListSinksResponse)(nil), "google.logging.v2.ListSinksResponse") + proto.RegisterType((*GetSinkRequest)(nil), "google.logging.v2.GetSinkRequest") + proto.RegisterType((*CreateSinkRequest)(nil), "google.logging.v2.CreateSinkRequest") + proto.RegisterType((*UpdateSinkRequest)(nil), "google.logging.v2.UpdateSinkRequest") + proto.RegisterType((*DeleteSinkRequest)(nil), "google.logging.v2.DeleteSinkRequest") + proto.RegisterEnum("google.logging.v2.LogSink_VersionFormat", LogSink_VersionFormat_name, LogSink_VersionFormat_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.SupportPackageIsVersion3 + +// Client API for ConfigServiceV2 service + +type ConfigServiceV2Client interface { + // Lists sinks. + ListSinks(ctx context.Context, in *ListSinksRequest, opts ...grpc.CallOption) (*ListSinksResponse, error) + // Gets a sink. + GetSink(ctx context.Context, in *GetSinkRequest, opts ...grpc.CallOption) (*LogSink, error) + // Creates a sink. + CreateSink(ctx context.Context, in *CreateSinkRequest, opts ...grpc.CallOption) (*LogSink, error) + // Updates or creates a sink. + UpdateSink(ctx context.Context, in *UpdateSinkRequest, opts ...grpc.CallOption) (*LogSink, error) + // Deletes a sink. + DeleteSink(ctx context.Context, in *DeleteSinkRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) +} + +type configServiceV2Client struct { + cc *grpc.ClientConn +} + +func NewConfigServiceV2Client(cc *grpc.ClientConn) ConfigServiceV2Client { + return &configServiceV2Client{cc} +} + +func (c *configServiceV2Client) ListSinks(ctx context.Context, in *ListSinksRequest, opts ...grpc.CallOption) (*ListSinksResponse, error) { + out := new(ListSinksResponse) + err := grpc.Invoke(ctx, "/google.logging.v2.ConfigServiceV2/ListSinks", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configServiceV2Client) GetSink(ctx context.Context, in *GetSinkRequest, opts ...grpc.CallOption) (*LogSink, error) { + out := new(LogSink) + err := grpc.Invoke(ctx, "/google.logging.v2.ConfigServiceV2/GetSink", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configServiceV2Client) CreateSink(ctx context.Context, in *CreateSinkRequest, opts ...grpc.CallOption) (*LogSink, error) { + out := new(LogSink) + err := grpc.Invoke(ctx, "/google.logging.v2.ConfigServiceV2/CreateSink", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configServiceV2Client) UpdateSink(ctx context.Context, in *UpdateSinkRequest, opts ...grpc.CallOption) (*LogSink, error) { + out := new(LogSink) + err := grpc.Invoke(ctx, "/google.logging.v2.ConfigServiceV2/UpdateSink", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *configServiceV2Client) DeleteSink(ctx context.Context, in *DeleteSinkRequest, opts ...grpc.CallOption) (*google_protobuf5.Empty, error) { + out := new(google_protobuf5.Empty) + err := grpc.Invoke(ctx, "/google.logging.v2.ConfigServiceV2/DeleteSink", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ConfigServiceV2 service + +type ConfigServiceV2Server interface { + // Lists sinks. + ListSinks(context.Context, *ListSinksRequest) (*ListSinksResponse, error) + // Gets a sink. + GetSink(context.Context, *GetSinkRequest) (*LogSink, error) + // Creates a sink. + CreateSink(context.Context, *CreateSinkRequest) (*LogSink, error) + // Updates or creates a sink. + UpdateSink(context.Context, *UpdateSinkRequest) (*LogSink, error) + // Deletes a sink. + DeleteSink(context.Context, *DeleteSinkRequest) (*google_protobuf5.Empty, error) +} + +func RegisterConfigServiceV2Server(s *grpc.Server, srv ConfigServiceV2Server) { + s.RegisterService(&_ConfigServiceV2_serviceDesc, srv) +} + +func _ConfigServiceV2_ListSinks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListSinksRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServiceV2Server).ListSinks(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.ConfigServiceV2/ListSinks", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServiceV2Server).ListSinks(ctx, req.(*ListSinksRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigServiceV2_GetSink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServiceV2Server).GetSink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.ConfigServiceV2/GetSink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServiceV2Server).GetSink(ctx, req.(*GetSinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigServiceV2_CreateSink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateSinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServiceV2Server).CreateSink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.ConfigServiceV2/CreateSink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServiceV2Server).CreateSink(ctx, req.(*CreateSinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigServiceV2_UpdateSink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateSinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServiceV2Server).UpdateSink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.ConfigServiceV2/UpdateSink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServiceV2Server).UpdateSink(ctx, req.(*UpdateSinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ConfigServiceV2_DeleteSink_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteSinkRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConfigServiceV2Server).DeleteSink(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/google.logging.v2.ConfigServiceV2/DeleteSink", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConfigServiceV2Server).DeleteSink(ctx, req.(*DeleteSinkRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _ConfigServiceV2_serviceDesc = grpc.ServiceDesc{ + ServiceName: "google.logging.v2.ConfigServiceV2", + HandlerType: (*ConfigServiceV2Server)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListSinks", + Handler: _ConfigServiceV2_ListSinks_Handler, + }, + { + MethodName: "GetSink", + Handler: _ConfigServiceV2_GetSink_Handler, + }, + { + MethodName: "CreateSink", + Handler: _ConfigServiceV2_CreateSink_Handler, + }, + { + MethodName: "UpdateSink", + Handler: _ConfigServiceV2_UpdateSink_Handler, + }, + { + MethodName: "DeleteSink", + Handler: _ConfigServiceV2_DeleteSink_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: fileDescriptor2, +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/logging/v2/logging_config.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x95, 0xdf, 0x4e, 0x13, 0x4d, + 0x14, 0xc0, 0xbf, 0x16, 0x28, 0x70, 0x08, 0xd0, 0xce, 0x17, 0x48, 0xb3, 0x06, 0xc5, 0x15, 0x94, + 0xd4, 0xb8, 0x5b, 0x97, 0x3b, 0x8d, 0x31, 0x02, 0xc5, 0x34, 0x41, 0x20, 0x5b, 0xe8, 0x05, 0x9a, + 0xac, 0x4b, 0x99, 0xae, 0x23, 0xdd, 0x99, 0x75, 0x77, 0x5a, 0x45, 0x42, 0x62, 0x7c, 0x05, 0x1f, + 0xc0, 0x87, 0xf2, 0x15, 0x7c, 0x0e, 0xe3, 0xec, 0xcc, 0x96, 0x16, 0x5a, 0xd6, 0x72, 0xb3, 0x9d, + 0x39, 0xff, 0x7e, 0x67, 0xce, 0x39, 0x33, 0x85, 0x8a, 0xc7, 0x98, 0xd7, 0xc2, 0x86, 0xc7, 0x5a, + 0x2e, 0xf5, 0x0c, 0x16, 0x7a, 0xa6, 0x87, 0x69, 0x10, 0x32, 0xce, 0x4c, 0xa5, 0x72, 0x03, 0x12, + 0x99, 0x2d, 0xe6, 0x79, 0x84, 0x7a, 0x66, 0xc7, 0xea, 0x2e, 0x9d, 0x06, 0xa3, 0x4d, 0xe2, 0x19, + 0xd2, 0x14, 0x15, 0x92, 0x30, 0x89, 0xd2, 0xe8, 0x58, 0x5a, 0x75, 0xb4, 0xc8, 0xe2, 0x63, 0x46, + 0x38, 0xec, 0x90, 0x06, 0x56, 0x11, 0x4d, 0x97, 0x52, 0xc6, 0x5d, 0x4e, 0x18, 0x8d, 0x54, 0x74, + 0x6d, 0xdd, 0x23, 0xfc, 0x43, 0xfb, 0xd8, 0x68, 0x30, 0xdf, 0x54, 0xe1, 0x4c, 0xa9, 0x38, 0x6e, + 0x37, 0xcd, 0x80, 0x9f, 0x05, 0x38, 0x32, 0xb1, 0x2f, 0x16, 0xea, 0x9b, 0x38, 0x3d, 0xff, 0xb7, + 0x13, 0x27, 0x3e, 0x8e, 0xb8, 0xeb, 0x07, 0xbd, 0x95, 0x72, 0xd6, 0x7f, 0x66, 0x61, 0x72, 0x87, + 0x79, 0x35, 0x42, 0x4f, 0x11, 0x82, 0x71, 0xea, 0xfa, 0xb8, 0x98, 0x59, 0xce, 0xac, 0x4d, 0xdb, + 0x72, 0x8d, 0x96, 0x61, 0xe6, 0x44, 0x38, 0x10, 0x2a, 0xf3, 0x2c, 0x8e, 0x49, 0x55, 0xbf, 0x08, + 0x2d, 0x42, 0xae, 0x49, 0x5a, 0x1c, 0x87, 0xc5, 0x09, 0xa9, 0x4c, 0x76, 0xe8, 0x1d, 0x2c, 0xb0, + 0x36, 0x0f, 0xda, 0xdc, 0xe9, 0xe0, 0x30, 0x12, 0x96, 0x4e, 0x93, 0x85, 0xbe, 0xcb, 0x8b, 0x39, + 0x61, 0x36, 0x67, 0xad, 0x19, 0x03, 0x95, 0x34, 0x92, 0x44, 0x8c, 0xba, 0x72, 0xd8, 0x96, 0xf6, + 0xf6, 0xff, 0x2a, 0xcc, 0x15, 0x21, 0x7a, 0x04, 0xf3, 0x9f, 0x43, 0x22, 0x38, 0x0e, 0x39, 0xc1, + 0x94, 0x13, 0x7e, 0x56, 0x9c, 0x92, 0xf8, 0x39, 0x25, 0xae, 0x26, 0x52, 0xfd, 0x25, 0xcc, 0x5e, + 0xf5, 0xbc, 0x0b, 0x5a, 0xbd, 0x62, 0xd7, 0xaa, 0x7b, 0xbb, 0xce, 0xf6, 0x9e, 0xfd, 0xe6, 0xd5, + 0x81, 0x73, 0xb8, 0x5b, 0xdb, 0xaf, 0x6c, 0x56, 0xb7, 0xab, 0x95, 0xad, 0xfc, 0x7f, 0x28, 0x07, + 0xd9, 0xba, 0x95, 0xcf, 0xc8, 0xdf, 0xa7, 0xf9, 0xac, 0xde, 0x84, 0xfc, 0x0e, 0x89, 0x78, 0x9c, + 0x58, 0x64, 0xe3, 0x4f, 0x6d, 0x71, 0xf4, 0xf8, 0xcc, 0x81, 0x1b, 0x0a, 0x42, 0x52, 0xab, 0x64, + 0x87, 0x96, 0x00, 0x02, 0xd7, 0xc3, 0x0e, 0x67, 0xa7, 0x98, 0x16, 0xb3, 0x52, 0x37, 0x1d, 0x4b, + 0x0e, 0x62, 0x01, 0xba, 0x03, 0x72, 0xe3, 0x44, 0xe4, 0x2b, 0x96, 0xa5, 0x9c, 0xb0, 0xa7, 0x62, + 0x41, 0x4d, 0xec, 0x75, 0x1f, 0x0a, 0x7d, 0x9c, 0x28, 0x10, 0x53, 0x81, 0x51, 0x19, 0x26, 0xa2, + 0x58, 0x20, 0x38, 0x63, 0x6b, 0x33, 0x96, 0x76, 0x73, 0xd1, 0x6c, 0x65, 0x88, 0x1e, 0xc2, 0x3c, + 0xc5, 0x5f, 0xb8, 0x33, 0x90, 0xc7, 0x6c, 0x2c, 0xde, 0xef, 0xe6, 0xa2, 0x3f, 0x81, 0xb9, 0xd7, + 0x58, 0xd2, 0xba, 0x87, 0x12, 0xd9, 0xc5, 0x21, 0x9c, 0xbe, 0x19, 0x98, 0x8a, 0x05, 0xbb, 0x62, + 0xaf, 0xbf, 0x85, 0xc2, 0x66, 0x88, 0x5d, 0x8e, 0xfb, 0x3d, 0x6e, 0x2a, 0x83, 0x01, 0xe3, 0xb1, + 0xa3, 0x04, 0xa7, 0x27, 0x2d, 0xed, 0xf4, 0xf7, 0x50, 0x38, 0x0c, 0x4e, 0xae, 0x05, 0x4f, 0x4b, + 0xe7, 0xd6, 0x84, 0x32, 0x14, 0xb6, 0x70, 0x0b, 0x8f, 0x4e, 0xb0, 0xfe, 0x8c, 0xc3, 0xfc, 0xa6, + 0xbc, 0xa7, 0x35, 0x75, 0x69, 0xeb, 0x16, 0xba, 0x80, 0xe9, 0xcb, 0x16, 0xa1, 0x07, 0xc3, 0xa0, + 0xd7, 0x06, 0x45, 0x5b, 0x49, 0x37, 0x52, 0x5d, 0xd6, 0x57, 0xbf, 0xff, 0xfa, 0xfd, 0x23, 0x7b, + 0x0f, 0x2d, 0xc5, 0xcf, 0xce, 0xb9, 0x2a, 0xe2, 0x0b, 0x71, 0x3f, 0x3f, 0xe2, 0x06, 0x8f, 0xcc, + 0xd2, 0x85, 0xa9, 0x5a, 0xcb, 0x61, 0x32, 0x69, 0x19, 0xba, 0x3f, 0x24, 0xee, 0xd5, 0x76, 0x6a, + 0x29, 0x45, 0xd1, 0x4b, 0x12, 0xb8, 0x82, 0x74, 0x09, 0xbc, 0x2c, 0x42, 0x1f, 0x53, 0x21, 0x05, + 0x1b, 0x9d, 0x03, 0xf4, 0x3a, 0x8f, 0x86, 0x1d, 0x68, 0x60, 0x30, 0x52, 0xd9, 0x8f, 0x25, 0x7b, + 0x55, 0x4f, 0x3f, 0xec, 0x33, 0xd9, 0x37, 0xf4, 0x2d, 0x03, 0xd0, 0x1b, 0x8d, 0xa1, 0xf4, 0x81, + 0xc9, 0x49, 0xa5, 0x97, 0x25, 0xbd, 0xa4, 0x8d, 0x70, 0xf2, 0x24, 0x85, 0x0e, 0x40, 0x6f, 0x74, + 0x86, 0x66, 0x30, 0x30, 0x59, 0xda, 0x62, 0xd7, 0xaa, 0xfb, 0x10, 0x1b, 0x95, 0xf8, 0xc1, 0xee, + 0xd6, 0xbd, 0x34, 0x02, 0x7d, 0xe3, 0x08, 0x16, 0xc4, 0x8b, 0x3e, 0x88, 0xdb, 0x98, 0xdd, 0x51, + 0x6b, 0x35, 0x9d, 0xfb, 0x99, 0xa3, 0xf2, 0x6d, 0xff, 0xda, 0x8e, 0x73, 0x52, 0xb9, 0xfe, 0x37, + 0x00, 0x00, 0xff, 0xff, 0x52, 0x86, 0xdf, 0xea, 0x15, 0x07, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.proto new file mode 100644 index 0000000000..fb9df625d8 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_config.proto @@ -0,0 +1,187 @@ +// 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. + +syntax = "proto3"; + +package google.logging.v2; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "github.com/golang/protobuf/ptypes/empty/empty.proto"; // from google/protobuf/empty.proto +import "github.com/golang/protobuf/ptypes/timestamp/timestamp.proto"; // from google/protobuf/timestamp.proto + +option java_multiple_files = true; +option java_outer_classname = "LoggingConfig"; +option java_package = "com.google.logging.v2"; + +option go_package = "google.golang.org/genproto/googleapis/logging/v2"; + +// Service for configuring sinks used to export log entries outside Stackdriver +// Logging. +service ConfigServiceV2 { + // Lists sinks. + rpc ListSinks(ListSinksRequest) returns (ListSinksResponse) { + option (google.api.http) = { get: "/v2/{parent=projects/*}/sinks" }; + } + + // Gets a sink. + rpc GetSink(GetSinkRequest) returns (LogSink) { + option (google.api.http) = { get: "/v2/{sink_name=projects/*/sinks/*}" }; + } + + // Creates a sink. + rpc CreateSink(CreateSinkRequest) returns (LogSink) { + option (google.api.http) = { post: "/v2/{parent=projects/*}/sinks" body: "sink" }; + } + + // Updates or creates a sink. + rpc UpdateSink(UpdateSinkRequest) returns (LogSink) { + option (google.api.http) = { put: "/v2/{sink_name=projects/*/sinks/*}" body: "sink" }; + } + + // Deletes a sink. + rpc DeleteSink(DeleteSinkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2/{sink_name=projects/*/sinks/*}" }; + } +} + +// Describes a sink used to export log entries outside Stackdriver Logging. +message LogSink { + // Available log entry formats. Log entries can be written to Cloud + // Logging in either format and can be exported in either format. + // Version 2 is the preferred format. + enum VersionFormat { + // An unspecified version format will default to V2. + VERSION_FORMAT_UNSPECIFIED = 0; + + // `LogEntry` version 2 format. + V2 = 1; + + // `LogEntry` version 1 format. + V1 = 2; + } + + // Required. The client-assigned sink identifier, unique within the + // project. Example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are + // limited to 1000 characters and can include only the following characters: + // `A-Z`, `a-z`, `0-9`, and the special characters `_-.`. The maximum length + // of the name is 100 characters. + string name = 1; + + // Required. The export destination. See + // [Exporting Logs With Sinks](/logging/docs/api/tasks/exporting-logs). + // Examples: + // + // "storage.googleapis.com/my-gcs-bucket" + // "bigquery.googleapis.com/projects/my-project-id/datasets/my-dataset" + // "pubsub.googleapis.com/projects/my-project/topics/my-topic" + string destination = 3; + + // Optional. An [advanced logs filter](/logging/docs/view/advanced_filters). + // Only log entries matching the filter are exported. The filter + // must be consistent with the log entry format specified by the + // `outputVersionFormat` parameter, regardless of the format of the + // log entry that was originally written to Stackdriver Logging. + // Example filter (V2 format): + // + // logName=projects/my-projectid/logs/syslog AND severity>=ERROR + string filter = 5; + + // Optional. The log entry version to use for this sink's exported log + // entries. This version does not have to correspond to the version of the + // log entry that was written to Stackdriver Logging. If omitted, the + // v2 format is used. + VersionFormat output_version_format = 6; + + // Output only. The iam identity to which the destination needs to grant write + // access. This may be a service account or a group. + // Examples (Do not assume these specific values): + // "serviceAccount:cloud-logs@system.gserviceaccount.com" + // "group:cloud-logs@google.com" + // + // For GCS destinations, the role "roles/owner" is required on the bucket + // For Cloud Pubsub destinations, the role "roles/pubsub.publisher" is + // required on the topic + // For BigQuery, the role "roles/editor" is required on the dataset + string writer_identity = 8; +} + +// The parameters to `ListSinks`. +message ListSinksRequest { + // Required. The cloud resource containing the sinks. + // Example: `"projects/my-logging-project"`. + string parent = 1; + + // 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. + string page_token = 2; + + // 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. + int32 page_size = 3; +} + +// Result returned from `ListSinks`. +message ListSinksResponse { + // A list of sinks. + repeated LogSink sinks = 1; + + // 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`. + string next_page_token = 2; +} + +// The parameters to `GetSink`. +message GetSinkRequest { + // Required. The resource name of the sink to return. + // Example: `"projects/my-project-id/sinks/my-sink-id"`. + string sink_name = 1; +} + +// The parameters to `CreateSink`. +message CreateSinkRequest { + // Required. The resource in which to create the sink. + // Example: `"projects/my-project-id"`. + // The new sink must be provided in the request. + string parent = 1; + + // Required. The new sink, whose `name` parameter is a sink identifier that + // is not already in use. + LogSink sink = 2; +} + +// The parameters to `UpdateSink`. +message UpdateSinkRequest { + // Required. The resource name of the sink to update, including the parent + // resource and the sink identifier. If the sink does not exist, this method + // creates the sink. Example: `"projects/my-project-id/sinks/my-sink-id"`. + string sink_name = 1; + + // Required. The updated sink, whose name is the same identifier that appears + // as part of `sinkName`. If `sinkName` does not exist, then + // this method creates a new sink. + LogSink sink = 2; +} + +// The parameters to `DeleteSink`. +message DeleteSinkRequest { + // Required. The resource name of the sink to delete, including the parent + // resource and the sink identifier. Example: + // `"projects/my-project-id/sinks/my-sink-id"`. It is an error if the sink + // does not exist. + string sink_name = 1; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.pb.go new file mode 100644 index 0000000000..bf2245c15c --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.pb.go @@ -0,0 +1,465 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto +// DO NOT EDIT! + +package v2 // import "google.golang.org/genproto/googleapis/logging/v2" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "google.golang.org/genproto/googleapis/api/serviceconfig" +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 + +// Stackdriver Logging API version. +type LogMetric_ApiVersion int32 + +const ( + // Stackdriver Logging API v2. + LogMetric_V2 LogMetric_ApiVersion = 0 + // Stackdriver Logging API v1. + LogMetric_V1 LogMetric_ApiVersion = 1 +) + +var LogMetric_ApiVersion_name = map[int32]string{ + 0: "V2", + 1: "V1", +} +var LogMetric_ApiVersion_value = map[string]int32{ + "V2": 0, + "V1": 1, +} + +func (x LogMetric_ApiVersion) String() string { + return proto.EnumName(LogMetric_ApiVersion_name, int32(x)) +} +func (LogMetric_ApiVersion) EnumDescriptor() ([]byte, []int) { return fileDescriptor3, []int{0, 0} } + +// Describes a logs-based metric. The value of the metric is the +// number of log entries that match a logs filter. +type LogMetric struct { + // Required. The client-assigned metric identifier. Example: + // `"severe_errors"`. Metric identifiers are limited to 100 + // characters and can include only the following characters: `A-Z`, + // `a-z`, `0-9`, and the special characters `_-.,+!*',()%/`. The + // forward-slash character (`/`) denotes a hierarchy of name pieces, + // and it cannot be the first character of the name. The '%' character + // is used to URL encode unsafe and reserved characters and must be + // followed by two hexadecimal digits according to RFC 1738. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Optional. A description of this metric, which is used in documentation. + Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` + // Required. An [advanced logs filter](/logging/docs/view/advanced_filters). + // Example: `"resource.type=gae_app AND severity>=ERROR"`. + Filter string `protobuf:"bytes,3,opt,name=filter" json:"filter,omitempty"` + // Output only. The API version that created or updated this metric. + // The version also dictates the syntax of the filter expression. When a value + // for this field is missing, the default value of V2 should be assumed. + 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} } + +// The parameters to ListLogMetrics. +type ListLogMetricsRequest struct { + // Required. The resource name containing the metrics. + // Example: `"projects/my-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} } + +// 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 +} + +// The parameters to GetLogMetric. +type GetLogMetricRequest struct { + // The resource name of the desired metric. + // Example: `"projects/my-project-id/metrics/my-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} } + +// The parameters to CreateLogMetric. +type CreateLogMetricRequest struct { + // The resource name of the project in which to create the metric. + // Example: `"projects/my-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) 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. + // Example: `"projects/my-project-id/metrics/my-metric-id"`. + // + // The updated metric must be provided in the request and have the + // same identifier that is specified in `metricName`. + // If the metric does not exist, it is created. + MetricName string `protobuf:"bytes,1,opt,name=metric_name,json=metricName" json:"metric_name,omitempty"` + // The updated metric, whose name must be the same as the + // metric identifier in `metricName`. If `metricName` does not + // exist, then a new metric is created. + 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) 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. + // Example: `"projects/my-project-id/metrics/my-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 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.SupportPackageIsVersion3 + +// 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: fileDescriptor3, +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto", fileDescriptor3) +} + +var fileDescriptor3 = []byte{ + // 648 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x4e, 0x14, 0x4f, + 0x10, 0xfe, 0x0d, 0x7f, 0x96, 0x1f, 0x85, 0x02, 0xb6, 0x61, 0x43, 0x46, 0x0c, 0x38, 0x07, 0x58, + 0x38, 0x4c, 0xe3, 0x60, 0x48, 0x34, 0xf1, 0x00, 0xfe, 0x8b, 0x09, 0x1a, 0xb2, 0x28, 0x07, 0x3d, + 0x6c, 0x86, 0xa1, 0xb6, 0x6d, 0xd9, 0x9d, 0x1e, 0xa7, 0x9b, 0x0d, 0x6a, 0xbc, 0x18, 0x6f, 0x26, + 0x1e, 0xf4, 0x6d, 0x7c, 0x0d, 0x7d, 0x04, 0x1f, 0xc4, 0x9e, 0xee, 0x19, 0x58, 0x77, 0x47, 0x76, + 0xe5, 0x32, 0xdb, 0x5d, 0x55, 0x5d, 0xdf, 0x57, 0x55, 0x5f, 0xf7, 0xc2, 0x43, 0x26, 0x04, 0x6b, + 0xa1, 0xcf, 0x44, 0x2b, 0x8c, 0x99, 0x2f, 0x52, 0x46, 0x19, 0xc6, 0x49, 0x2a, 0x94, 0xa0, 0xd6, + 0x15, 0x26, 0x5c, 0xd2, 0x96, 0x60, 0x8c, 0xc7, 0x8c, 0x76, 0x82, 0x62, 0xd9, 0x68, 0xa3, 0x4a, + 0x79, 0x24, 0x7d, 0x13, 0x4b, 0xae, 0xe4, 0x79, 0x72, 0xaf, 0xdf, 0x09, 0xdc, 0xc7, 0xc3, 0xa5, + 0xd6, 0x1f, 0x2a, 0x31, 0xed, 0xf0, 0x08, 0x23, 0x11, 0x37, 0x39, 0xa3, 0x61, 0x1c, 0x0b, 0x15, + 0x2a, 0x2e, 0xe2, 0x3c, 0xbb, 0xbb, 0xc1, 0xb8, 0x7a, 0x75, 0x7c, 0xe0, 0x47, 0xa2, 0x4d, 0x6d, + 0x3a, 0x6a, 0x1c, 0x07, 0xc7, 0x4d, 0x9a, 0xa8, 0xb7, 0x09, 0x4a, 0x8a, 0x6d, 0xbd, 0xb0, 0x5f, + 0x7b, 0xc8, 0xfb, 0xee, 0xc0, 0xe4, 0x8e, 0x60, 0x4f, 0x0c, 0x4f, 0x42, 0x60, 0x2c, 0x0e, 0xdb, + 0x38, 0xef, 0x2c, 0x39, 0xb5, 0xc9, 0xba, 0x59, 0x93, 0x25, 0x98, 0x3a, 0x44, 0x19, 0xa5, 0x3c, + 0xc9, 0xc0, 0xe6, 0x47, 0x8c, 0xab, 0xdb, 0x44, 0xaa, 0x50, 0x69, 0xf2, 0x96, 0xc2, 0x74, 0x7e, + 0xd4, 0x38, 0xf3, 0x1d, 0xd9, 0x82, 0x89, 0x0e, 0xa6, 0x32, 0x3b, 0x35, 0xa6, 0x1d, 0xd3, 0xc1, + 0x8a, 0xdf, 0xd7, 0x00, 0xff, 0x14, 0xdc, 0xdf, 0x4a, 0xf8, 0xbe, 0x0d, 0xaf, 0x17, 0xe7, 0xbc, + 0x05, 0x80, 0x33, 0x33, 0xa9, 0xc0, 0xc8, 0x7e, 0x30, 0xfb, 0x9f, 0xf9, 0xbd, 0x39, 0xeb, 0x78, + 0x47, 0x30, 0xb7, 0xc3, 0xa5, 0x3a, 0x4d, 0x21, 0xeb, 0xf8, 0xe6, 0x18, 0xa5, 0xca, 0x18, 0x25, + 0x61, 0x8a, 0xb1, 0xca, 0x2b, 0xc9, 0x77, 0xe4, 0x3a, 0x40, 0x12, 0x32, 0x6c, 0x28, 0x71, 0x84, + 0x45, 0x29, 0x93, 0x99, 0xe5, 0x59, 0x66, 0x20, 0xd7, 0xc0, 0x6c, 0x1a, 0x92, 0xbf, 0x43, 0x53, + 0xcb, 0x78, 0xfd, 0xff, 0xcc, 0xb0, 0xa7, 0xf7, 0xde, 0x09, 0x54, 0x7b, 0xc1, 0x64, 0xa2, 0xbb, + 0x8f, 0x64, 0x13, 0x26, 0xf2, 0x39, 0x6b, 0xb8, 0xd1, 0xda, 0x54, 0xb0, 0x70, 0x5e, 0x9d, 0xf5, + 0x22, 0x98, 0x2c, 0xc3, 0x4c, 0x8c, 0x27, 0xaa, 0xd1, 0x47, 0xe9, 0x72, 0x66, 0xde, 0x2d, 0x68, + 0x79, 0x9b, 0x70, 0xf5, 0x11, 0x9e, 0x01, 0x17, 0x45, 0x2e, 0xc2, 0x94, 0xcd, 0xd4, 0xe8, 0x9a, + 0x19, 0x58, 0xd3, 0x53, 0x6d, 0xf1, 0x9a, 0x50, 0xbd, 0x97, 0x62, 0xa8, 0xb0, 0xef, 0xe8, 0xdf, + 0xfa, 0x73, 0x0b, 0x2a, 0xf6, 0xbc, 0x21, 0x32, 0xa8, 0x90, 0x3c, 0xd6, 0x13, 0x50, 0x7d, 0x9e, + 0x1c, 0x96, 0xe1, 0x0c, 0xa2, 0x78, 0x41, 0xc0, 0xdb, 0x50, 0xbd, 0x8f, 0x2d, 0xbc, 0x00, 0x60, + 0xf0, 0x73, 0x1c, 0x66, 0xf3, 0xf9, 0xed, 0xd9, 0xfb, 0xb4, 0x1f, 0x90, 0x2f, 0x0e, 0x4c, 0xff, + 0x39, 0x5b, 0x52, 0x2b, 0x23, 0x52, 0xa6, 0x35, 0x77, 0x75, 0x88, 0x48, 0x2b, 0x14, 0x6f, 0xe5, + 0xe3, 0x8f, 0x5f, 0xdf, 0x46, 0x6e, 0x90, 0xc5, 0xec, 0x89, 0x78, 0x6f, 0x7b, 0x7e, 0x57, 0xdf, + 0xc3, 0xd7, 0x18, 0x29, 0x49, 0xd7, 0x3e, 0xd0, 0x42, 0x19, 0x9f, 0x1c, 0xb8, 0xd4, 0x3d, 0x72, + 0xb2, 0x5c, 0x02, 0x52, 0xa2, 0x09, 0xf7, 0xdc, 0xfe, 0x79, 0xbe, 0xc1, 0xaf, 0x91, 0x65, 0x83, + 0xdf, 0xd5, 0xa8, 0x2e, 0x12, 0x05, 0x07, 0x4d, 0x87, 0x7c, 0x76, 0x60, 0xa6, 0x47, 0x41, 0xa4, + 0xac, 0xdc, 0x72, 0x95, 0x0d, 0x20, 0x43, 0x0d, 0x99, 0x55, 0x6f, 0x50, 0x33, 0xee, 0xe4, 0x53, + 0x27, 0x5f, 0x35, 0x9b, 0x1e, 0x9d, 0x95, 0xb2, 0x29, 0xd7, 0xe2, 0x00, 0x36, 0x9b, 0x86, 0xcd, + 0xba, 0x3b, 0x64, 0x6b, 0x4e, 0x49, 0xe9, 0x49, 0xcd, 0xf4, 0x68, 0xb1, 0x94, 0x54, 0xb9, 0x5e, + 0xdd, 0x6a, 0x11, 0x5a, 0xbc, 0xd4, 0xfe, 0x83, 0xec, 0x71, 0x2e, 0x26, 0xb5, 0x36, 0x24, 0x9d, + 0xed, 0x97, 0x30, 0xa7, 0x9f, 0xfd, 0x7e, 0xdc, 0xed, 0xe9, 0x1d, 0xbb, 0xce, 0xa5, 0xb8, 0xeb, + 0xbc, 0x58, 0xff, 0xd7, 0x3f, 0xb3, 0x83, 0x8a, 0x71, 0x6e, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, + 0x46, 0x24, 0x21, 0x19, 0x07, 0x07, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto new file mode 100644 index 0000000000..3ef61903df --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/logging/v2/logging_metrics.proto @@ -0,0 +1,161 @@ +// 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. + +syntax = "proto3"; + +package google.logging.v2; + +import "google.golang.org/genproto/googleapis/api/serviceconfig/annotations.proto"; // from google/api/annotations.proto +import "github.com/golang/protobuf/ptypes/empty/empty.proto"; // from google/protobuf/empty.proto + +option java_multiple_files = true; +option java_outer_classname = "LoggingMetrics"; +option java_package = "com.google.logging.v2"; + +option go_package = "google.golang.org/genproto/googleapis/logging/v2"; + +// Service for configuring logs-based metrics. +service MetricsServiceV2 { + // Lists logs-based metrics. + rpc ListLogMetrics(ListLogMetricsRequest) returns (ListLogMetricsResponse) { + option (google.api.http) = { get: "/v2/{parent=projects/*}/metrics" }; + } + + // Gets a logs-based metric. + rpc GetLogMetric(GetLogMetricRequest) returns (LogMetric) { + option (google.api.http) = { get: "/v2/{metric_name=projects/*/metrics/*}" }; + } + + // Creates a logs-based metric. + rpc CreateLogMetric(CreateLogMetricRequest) returns (LogMetric) { + option (google.api.http) = { post: "/v2/{parent=projects/*}/metrics" body: "metric" }; + } + + // Creates or updates a logs-based metric. + rpc UpdateLogMetric(UpdateLogMetricRequest) returns (LogMetric) { + option (google.api.http) = { put: "/v2/{metric_name=projects/*/metrics/*}" body: "metric" }; + } + + // Deletes a logs-based metric. + rpc DeleteLogMetric(DeleteLogMetricRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { delete: "/v2/{metric_name=projects/*/metrics/*}" }; + } +} + +// Describes a logs-based metric. The value of the metric is the +// number of log entries that match a logs filter. +message LogMetric { + // Stackdriver Logging API version. + enum ApiVersion { + // Stackdriver Logging API v2. + V2 = 0; + + // Stackdriver Logging API v1. + V1 = 1; + } + + // Required. The client-assigned metric identifier. Example: + // `"severe_errors"`. Metric identifiers are limited to 100 + // characters and can include only the following characters: `A-Z`, + // `a-z`, `0-9`, and the special characters `_-.,+!*',()%/`. The + // forward-slash character (`/`) denotes a hierarchy of name pieces, + // and it cannot be the first character of the name. The '%' character + // is used to URL encode unsafe and reserved characters and must be + // followed by two hexadecimal digits according to RFC 1738. + string name = 1; + + // Optional. A description of this metric, which is used in documentation. + string description = 2; + + // Required. An [advanced logs filter](/logging/docs/view/advanced_filters). + // Example: `"resource.type=gae_app AND severity>=ERROR"`. + string filter = 3; + + // Output only. The API version that created or updated this metric. + // The version also dictates the syntax of the filter expression. When a value + // for this field is missing, the default value of V2 should be assumed. + ApiVersion version = 4; +} + +// The parameters to ListLogMetrics. +message ListLogMetricsRequest { + // Required. The resource name containing the metrics. + // Example: `"projects/my-project-id"`. + string parent = 1; + + // 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. + string page_token = 2; + + // 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. + int32 page_size = 3; +} + +// Result returned from ListLogMetrics. +message ListLogMetricsResponse { + // A list of logs-based metrics. + repeated LogMetric metrics = 1; + + // 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`. + string next_page_token = 2; +} + +// The parameters to GetLogMetric. +message GetLogMetricRequest { + // The resource name of the desired metric. + // Example: `"projects/my-project-id/metrics/my-metric-id"`. + string metric_name = 1; +} + +// The parameters to CreateLogMetric. +message CreateLogMetricRequest { + // The resource name of the project in which to create the metric. + // Example: `"projects/my-project-id"`. + // + // The new metric must be provided in the request. + string parent = 1; + + // The new logs-based metric, which must not have an identifier that + // already exists. + LogMetric metric = 2; +} + +// The parameters to UpdateLogMetric. +message UpdateLogMetricRequest { + // The resource name of the metric to update. + // Example: `"projects/my-project-id/metrics/my-metric-id"`. + // + // The updated metric must be provided in the request and have the + // same identifier that is specified in `metricName`. + // If the metric does not exist, it is created. + string metric_name = 1; + + // The updated metric, whose name must be the same as the + // metric identifier in `metricName`. If `metricName` does not + // exist, then a new metric is created. + LogMetric metric = 2; +} + +// The parameters to DeleteLogMetric. +message DeleteLogMetricRequest { + // The resource name of the metric to delete. + // Example: `"projects/my-project-id/metrics/my-metric-id"`. + string metric_name = 1; +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go new file mode 100644 index 0000000000..3c6c8518d2 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -0,0 +1,131 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/googleapis/rpc/status/status.proto +// DO NOT EDIT! + +/* +Package google_rpc is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/googleapis/rpc/status/status.proto + +It has these top-level messages: + Status +*/ +package google_rpc // import "google.golang.org/genproto/googleapis/rpc/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` which 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 purpose. +// +// - 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 will be 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) 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.golang.org/genproto/googleapis/rpc/status/status.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 208 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x44, 0x8e, 0xcd, 0x4e, 0x84, 0x30, + 0x10, 0xc7, 0x83, 0xab, 0xbb, 0xb1, 0x9b, 0x78, 0x68, 0x3c, 0x34, 0x5e, 0xdc, 0x78, 0xe2, 0x34, + 0x93, 0xe8, 0xd9, 0x83, 0x3c, 0x01, 0xc1, 0x27, 0x28, 0x50, 0x46, 0x12, 0xe8, 0x34, 0xb4, 0x1c, + 0x78, 0x7b, 0xa1, 0x85, 0xec, 0xa1, 0x69, 0x3b, 0xf3, 0xfb, 0x7f, 0x88, 0x6f, 0x62, 0xa6, 0xc1, + 0x00, 0xf1, 0xa0, 0x2d, 0x01, 0x4f, 0x84, 0x64, 0xac, 0x9b, 0x38, 0x30, 0xa6, 0x95, 0x76, 0xbd, + 0xc7, 0xc9, 0x35, 0xe8, 0x83, 0x0e, 0xb3, 0xdf, 0x2f, 0x88, 0x88, 0x14, 0xbb, 0x7c, 0xdd, 0xbf, + 0x21, 0xf5, 0xe1, 0x6f, 0xae, 0xa1, 0xe1, 0x11, 0x93, 0x1d, 0x46, 0xa8, 0x9e, 0x3b, 0x74, 0x61, + 0x71, 0xc6, 0xa3, 0xb6, 0xcb, 0x76, 0x92, 0xf8, 0xa3, 0x13, 0xe7, 0xdf, 0x68, 0x26, 0xa5, 0x78, + 0x6c, 0xb8, 0x35, 0x2a, 0xbb, 0x65, 0xf9, 0x53, 0x15, 0xdf, 0x52, 0x89, 0xcb, 0x68, 0xbc, 0xd7, + 0x64, 0xd4, 0xc3, 0x3a, 0x7e, 0xae, 0x8e, 0xaf, 0x04, 0x71, 0x69, 0x4d, 0xd0, 0xfd, 0xe0, 0xd5, + 0xe9, 0x76, 0xca, 0xaf, 0x9f, 0xaf, 0xb0, 0xd7, 0x38, 0xf2, 0xe0, 0xc7, 0x2e, 0xd5, 0x01, 0x15, + 0xef, 0xe2, 0x65, 0xed, 0x04, 0xf7, 0xaa, 0xc5, 0x35, 0xe5, 0x96, 0x1b, 0x5e, 0x66, 0xf5, 0x39, + 0xea, 0xbe, 0xfe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x73, 0x63, 0xb7, 0xba, 0x0d, 0x01, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.proto b/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.proto new file mode 100644 index 0000000000..c1d69e9c05 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/googleapis/rpc/status/status.proto @@ -0,0 +1,90 @@ +// Copyright (c) 2015, 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. + +syntax = "proto3"; + +package google.rpc; + +import "github.com/golang/protobuf/ptypes/any/any.proto"; // from google/protobuf/any.proto + +option java_multiple_files = true; +option java_outer_classname = "StatusProto"; +option java_package = "com.google.rpc"; + + +// 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` which 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 purpose. +// +// - 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. +message Status { + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + int32 code = 1; + + // 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. + string message = 2; + + // A list of messages that carry the error details. There will be a + // common set of message types for APIs to use. + repeated google.protobuf.Any details = 3; +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/api.pb.go b/components/engine/vendor/google.golang.org/genproto/protobuf/api.pb.go new file mode 100644 index 0000000000..1705e34355 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/api.pb.go @@ -0,0 +1,295 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/protobuf/api.proto +// DO NOT EDIT! + +/* +Package descriptor is a generated protocol buffer package. + +It is generated from these files: + google.golang.org/genproto/protobuf/api.proto + google.golang.org/genproto/protobuf/descriptor.proto + google.golang.org/genproto/protobuf/field_mask.proto + google.golang.org/genproto/protobuf/source_context.proto + google.golang.org/genproto/protobuf/type.proto + +It has these top-level messages: + Api + Method + Mixin + FileDescriptorSet + FileDescriptorProto + DescriptorProto + FieldDescriptorProto + OneofDescriptorProto + EnumDescriptorProto + EnumValueDescriptorProto + ServiceDescriptorProto + MethodDescriptorProto + FileOptions + MessageOptions + FieldOptions + OneofOptions + EnumOptions + EnumValueOptions + ServiceOptions + MethodOptions + UninterpretedOption + SourceCodeInfo + GeneratedCodeInfo + FieldMask + SourceContext + Type + Field + Enum + EnumValue + Option +*/ +package descriptor // import "google.golang.org/genproto/protobuf" + +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 + +// Api is a light-weight descriptor for a protocol buffer service. +type Api struct { + // The fully qualified name of this api, including package name + // followed by the api's simple name. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The methods of this api, in unspecified order. + Methods []*Method `protobuf:"bytes,2,rep,name=methods" json:"methods,omitempty"` + // Any metadata attached to the API. + Options []*Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"` + // A version string for this api. 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 + // API, 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, none-GA apis. + // + // + Version string `protobuf:"bytes,4,opt,name=version" json:"version,omitempty"` + // Source context for the protocol buffer service represented by this + // message. + SourceContext *SourceContext `protobuf:"bytes,5,opt,name=source_context,json=sourceContext" json:"source_context,omitempty"` + // Included APIs. See [Mixin][]. + Mixins []*Mixin `protobuf:"bytes,6,rep,name=mixins" json:"mixins,omitempty"` + // The source syntax of the service. + Syntax 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) GetMethods() []*Method { + if m != nil { + return m.Methods + } + return nil +} + +func (m *Api) GetOptions() []*Option { + if m != nil { + return m.Options + } + return nil +} + +func (m *Api) GetSourceContext() *SourceContext { + if m != nil { + return m.SourceContext + } + return nil +} + +func (m *Api) GetMixins() []*Mixin { + if m != nil { + return m.Mixins + } + return nil +} + +// Method represents a method of an api. +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 []*Option `protobuf:"bytes,6,rep,name=options" json:"options,omitempty"` + // The source syntax of this method. + Syntax 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) GetOptions() []*Option { + if m != nil { + return m.Options + } + return nil +} + +// Declares an API to be included in this API. The including API must +// redeclare all the methods from the included API, 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 API 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 API 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 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.golang.org/genproto/protobuf/api.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 424 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x52, 0x4f, 0x4f, 0xe2, 0x40, + 0x14, 0x4f, 0x5b, 0x28, 0xec, 0x90, 0x85, 0xdd, 0xd9, 0x64, 0xb7, 0xe1, 0x40, 0x08, 0xa7, 0x66, + 0x37, 0xb4, 0x59, 0xbc, 0x78, 0x15, 0x63, 0x38, 0x10, 0x63, 0x53, 0x34, 0x1e, 0x49, 0xc1, 0xb1, + 0x36, 0x69, 0x67, 0xea, 0xcc, 0x54, 0xe1, 0xdb, 0x18, 0x8f, 0x1e, 0xfd, 0x06, 0x7e, 0x33, 0xa7, + 0xd3, 0x0e, 0x20, 0x60, 0x82, 0x97, 0x66, 0xde, 0xfb, 0xfd, 0x79, 0xf3, 0x7e, 0x53, 0xd0, 0x0f, + 0x09, 0x09, 0x63, 0xe4, 0x84, 0x24, 0x0e, 0x70, 0xe8, 0x10, 0x1a, 0xba, 0x21, 0xc2, 0x29, 0x25, + 0x9c, 0xb8, 0xf2, 0x3b, 0xcb, 0x6e, 0xdd, 0x20, 0x8d, 0x1c, 0x59, 0xc0, 0x56, 0x49, 0x57, 0x50, + 0xfb, 0xf8, 0x10, 0x3d, 0x23, 0x19, 0x9d, 0xa3, 0xe9, 0x9c, 0x60, 0x8e, 0x16, 0xbc, 0x10, 0xb7, + 0x9d, 0x43, 0x94, 0x7c, 0x99, 0x96, 0xc3, 0x7a, 0x6f, 0x3a, 0x30, 0x4e, 0xd2, 0x08, 0x42, 0x50, + 0xc1, 0x41, 0x82, 0x2c, 0xad, 0xab, 0xd9, 0xdf, 0x7c, 0x79, 0x86, 0xff, 0x41, 0x2d, 0x41, 0xfc, + 0x8e, 0xdc, 0x30, 0x4b, 0xef, 0x1a, 0x76, 0x63, 0xf0, 0xc7, 0xd9, 0xba, 0xa8, 0x73, 0x2e, 0x71, + 0x5f, 0xf1, 0x72, 0x09, 0x49, 0x79, 0x44, 0x30, 0xb3, 0x8c, 0x4f, 0x24, 0x17, 0x12, 0xf7, 0x15, + 0x0f, 0x5a, 0xa0, 0xf6, 0x80, 0x28, 0x13, 0x67, 0xab, 0x22, 0x87, 0xab, 0x12, 0x9e, 0x81, 0xe6, + 0xc7, 0x1d, 0xad, 0xaa, 0x20, 0x34, 0x06, 0x9d, 0x1d, 0xcf, 0x89, 0xa4, 0x9d, 0x16, 0x2c, 0xff, + 0x3b, 0xdb, 0x2c, 0xa1, 0x03, 0xcc, 0x24, 0x5a, 0x44, 0xe2, 0x4a, 0xa6, 0xbc, 0xd2, 0xef, 0xdd, + 0x2d, 0x72, 0xd8, 0x2f, 0x59, 0xd0, 0x05, 0x26, 0x5b, 0x62, 0x1e, 0x2c, 0xac, 0x9a, 0x18, 0xd7, + 0xdc, 0xb3, 0xc2, 0x44, 0xc2, 0x7e, 0x49, 0xeb, 0xbd, 0xea, 0xc0, 0x2c, 0x82, 0xd8, 0x1b, 0xa3, + 0x0d, 0x7e, 0x50, 0x74, 0x9f, 0x21, 0xc6, 0xa7, 0x79, 0xf0, 0xd3, 0x8c, 0xc6, 0x22, 0xcf, 0x1c, + 0x6f, 0x96, 0xfd, 0x4b, 0xd1, 0xbe, 0xa2, 0x31, 0xfc, 0x07, 0x7e, 0x2a, 0x26, 0xe3, 0x14, 0x05, + 0x49, 0x84, 0x43, 0x91, 0xa3, 0x66, 0xd7, 0x7d, 0x65, 0x31, 0x51, 0x7d, 0xf8, 0x37, 0x27, 0xb3, + 0x54, 0x44, 0x88, 0xd6, 0xbe, 0x45, 0x82, 0x2d, 0x05, 0x28, 0xe3, 0x3e, 0x80, 0x2b, 0xee, 0xda, + 0xb9, 0x2a, 0x9d, 0x57, 0x2e, 0x6b, 0xeb, 0x8d, 0x57, 0x34, 0x0f, 0x7c, 0xc5, 0x2f, 0x87, 0xe6, + 0x82, 0xaa, 0x8c, 0x7d, 0x6f, 0x64, 0xa2, 0x47, 0x09, 0xe1, 0x65, 0x4c, 0xf2, 0x3c, 0x1c, 0x83, + 0x5f, 0x73, 0x92, 0x6c, 0xdb, 0x0e, 0xeb, 0xe2, 0xef, 0xf5, 0xf2, 0xc2, 0xd3, 0x9e, 0x34, 0xed, + 0x59, 0x37, 0x46, 0xde, 0xf0, 0x45, 0xef, 0x8c, 0x0a, 0x9a, 0xa7, 0xa6, 0x5f, 0xa3, 0x38, 0x1e, + 0x63, 0xf2, 0x88, 0xf3, 0x48, 0xd8, 0xcc, 0x94, 0xfa, 0xa3, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x97, 0x07, 0xcf, 0x1c, 0xa9, 0x03, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/api.proto b/components/engine/vendor/google.golang.org/genproto/protobuf/api.proto new file mode 100644 index 0000000000..f08a7f8507 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/api.proto @@ -0,0 +1,202 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +import "google.golang.org/genproto/protobuf/source_context.proto"; // from google/protobuf/source_context.proto +import "google.golang.org/genproto/protobuf/type.proto"; // from google/protobuf/type.proto + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + +// Api is a light-weight descriptor for a protocol buffer service. +message Api { + + // The fully qualified name of this api, including package name + // followed by the api's simple name. + string name = 1; + + // The methods of this api, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the API. + repeated Option options = 3; + + // A version string for this api. 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 + // API, 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, none-GA apis. + // + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included APIs. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an api. +message Method { + + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API to be included in this API. The including API must +// redeclare all the methods from the included API, 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 API 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"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the API which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.pb.go b/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.pb.go new file mode 100644 index 0000000000..cb40e13377 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.pb.go @@ -0,0 +1,2044 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/protobuf/descriptor.proto +// DO NOT EDIT! + +package descriptor // import "google.golang.org/genproto/protobuf" + +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 FieldDescriptorProto_Type int32 + +const ( + // 0 is reserved for errors. + // Order is weird for historical reasons. + FieldDescriptorProto_TYPE_DOUBLE FieldDescriptorProto_Type = 1 + FieldDescriptorProto_TYPE_FLOAT FieldDescriptorProto_Type = 2 + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + FieldDescriptorProto_TYPE_INT64 FieldDescriptorProto_Type = 3 + FieldDescriptorProto_TYPE_UINT64 FieldDescriptorProto_Type = 4 + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + FieldDescriptorProto_TYPE_INT32 FieldDescriptorProto_Type = 5 + FieldDescriptorProto_TYPE_FIXED64 FieldDescriptorProto_Type = 6 + FieldDescriptorProto_TYPE_FIXED32 FieldDescriptorProto_Type = 7 + FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 + FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 + FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 + FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 + // New in version 2. + FieldDescriptorProto_TYPE_BYTES FieldDescriptorProto_Type = 12 + FieldDescriptorProto_TYPE_UINT32 FieldDescriptorProto_Type = 13 + FieldDescriptorProto_TYPE_ENUM FieldDescriptorProto_Type = 14 + FieldDescriptorProto_TYPE_SFIXED32 FieldDescriptorProto_Type = 15 + FieldDescriptorProto_TYPE_SFIXED64 FieldDescriptorProto_Type = 16 + FieldDescriptorProto_TYPE_SINT32 FieldDescriptorProto_Type = 17 + FieldDescriptorProto_TYPE_SINT64 FieldDescriptorProto_Type = 18 +) + +var FieldDescriptorProto_Type_name = map[int32]string{ + 1: "TYPE_DOUBLE", + 2: "TYPE_FLOAT", + 3: "TYPE_INT64", + 4: "TYPE_UINT64", + 5: "TYPE_INT32", + 6: "TYPE_FIXED64", + 7: "TYPE_FIXED32", + 8: "TYPE_BOOL", + 9: "TYPE_STRING", + 10: "TYPE_GROUP", + 11: "TYPE_MESSAGE", + 12: "TYPE_BYTES", + 13: "TYPE_UINT32", + 14: "TYPE_ENUM", + 15: "TYPE_SFIXED32", + 16: "TYPE_SFIXED64", + 17: "TYPE_SINT32", + 18: "TYPE_SINT64", +} +var FieldDescriptorProto_Type_value = map[string]int32{ + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18, +} + +func (x FieldDescriptorProto_Type) Enum() *FieldDescriptorProto_Type { + p := new(FieldDescriptorProto_Type) + *p = x + return p +} +func (x FieldDescriptorProto_Type) String() string { + return proto.EnumName(FieldDescriptorProto_Type_name, int32(x)) +} +func (x *FieldDescriptorProto_Type) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Type_value, data, "FieldDescriptorProto_Type") + if err != nil { + return err + } + *x = FieldDescriptorProto_Type(value) + return nil +} +func (FieldDescriptorProto_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +type FieldDescriptorProto_Label int32 + +const ( + // 0 is reserved for errors + FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 + FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 + FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 +) + +var FieldDescriptorProto_Label_name = map[int32]string{ + 1: "LABEL_OPTIONAL", + 2: "LABEL_REQUIRED", + 3: "LABEL_REPEATED", +} +var FieldDescriptorProto_Label_value = map[string]int32{ + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3, +} + +func (x FieldDescriptorProto_Label) Enum() *FieldDescriptorProto_Label { + p := new(FieldDescriptorProto_Label) + *p = x + return p +} +func (x FieldDescriptorProto_Label) String() string { + return proto.EnumName(FieldDescriptorProto_Label_name, int32(x)) +} +func (x *FieldDescriptorProto_Label) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FieldDescriptorProto_Label_value, data, "FieldDescriptorProto_Label") + if err != nil { + return err + } + *x = FieldDescriptorProto_Label(value) + return nil +} +func (FieldDescriptorProto_Label) EnumDescriptor() ([]byte, []int) { + return fileDescriptor1, []int{3, 1} +} + +// Generated classes can be optimized for speed or code size. +type FileOptions_OptimizeMode int32 + +const ( + FileOptions_SPEED FileOptions_OptimizeMode = 1 + // etc. + FileOptions_CODE_SIZE FileOptions_OptimizeMode = 2 + FileOptions_LITE_RUNTIME FileOptions_OptimizeMode = 3 +) + +var FileOptions_OptimizeMode_name = map[int32]string{ + 1: "SPEED", + 2: "CODE_SIZE", + 3: "LITE_RUNTIME", +} +var FileOptions_OptimizeMode_value = map[string]int32{ + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3, +} + +func (x FileOptions_OptimizeMode) Enum() *FileOptions_OptimizeMode { + p := new(FileOptions_OptimizeMode) + *p = x + return p +} +func (x FileOptions_OptimizeMode) String() string { + return proto.EnumName(FileOptions_OptimizeMode_name, int32(x)) +} +func (x *FileOptions_OptimizeMode) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FileOptions_OptimizeMode_value, data, "FileOptions_OptimizeMode") + if err != nil { + return err + } + *x = FileOptions_OptimizeMode(value) + return nil +} +func (FileOptions_OptimizeMode) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{9, 0} } + +type FieldOptions_CType int32 + +const ( + // Default mode. + FieldOptions_STRING FieldOptions_CType = 0 + FieldOptions_CORD FieldOptions_CType = 1 + FieldOptions_STRING_PIECE FieldOptions_CType = 2 +) + +var FieldOptions_CType_name = map[int32]string{ + 0: "STRING", + 1: "CORD", + 2: "STRING_PIECE", +} +var FieldOptions_CType_value = map[string]int32{ + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2, +} + +func (x FieldOptions_CType) Enum() *FieldOptions_CType { + p := new(FieldOptions_CType) + *p = x + return p +} +func (x FieldOptions_CType) String() string { + return proto.EnumName(FieldOptions_CType_name, int32(x)) +} +func (x *FieldOptions_CType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FieldOptions_CType_value, data, "FieldOptions_CType") + if err != nil { + return err + } + *x = FieldOptions_CType(value) + return nil +} +func (FieldOptions_CType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{11, 0} } + +type FieldOptions_JSType int32 + +const ( + // Use the default type. + FieldOptions_JS_NORMAL FieldOptions_JSType = 0 + // Use JavaScript strings. + FieldOptions_JS_STRING FieldOptions_JSType = 1 + // Use JavaScript numbers. + FieldOptions_JS_NUMBER FieldOptions_JSType = 2 +) + +var FieldOptions_JSType_name = map[int32]string{ + 0: "JS_NORMAL", + 1: "JS_STRING", + 2: "JS_NUMBER", +} +var FieldOptions_JSType_value = map[string]int32{ + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2, +} + +func (x FieldOptions_JSType) Enum() *FieldOptions_JSType { + p := new(FieldOptions_JSType) + *p = x + return p +} +func (x FieldOptions_JSType) String() string { + return proto.EnumName(FieldOptions_JSType_name, int32(x)) +} +func (x *FieldOptions_JSType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(FieldOptions_JSType_value, data, "FieldOptions_JSType") + if err != nil { + return err + } + *x = FieldOptions_JSType(value) + return nil +} +func (FieldOptions_JSType) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{11, 1} } + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +type FileDescriptorSet struct { + File []*FileDescriptorProto `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FileDescriptorSet) Reset() { *m = FileDescriptorSet{} } +func (m *FileDescriptorSet) String() string { return proto.CompactTextString(m) } +func (*FileDescriptorSet) ProtoMessage() {} +func (*FileDescriptorSet) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *FileDescriptorSet) GetFile() []*FileDescriptorProto { + if m != nil { + return m.File + } + return nil +} + +// Describes a complete .proto file. +type FileDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` + // Names of files imported by this file. + Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` + // Indexes of the public imported files in the dependency list above. + PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` + // All top-level definitions in this file. + MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` + EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` + Service []*ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` + Extension []*FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` + Options *FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + SourceCodeInfo *SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FileDescriptorProto) Reset() { *m = FileDescriptorProto{} } +func (m *FileDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*FileDescriptorProto) ProtoMessage() {} +func (*FileDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +func (m *FileDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *FileDescriptorProto) GetPackage() string { + if m != nil && m.Package != nil { + return *m.Package + } + return "" +} + +func (m *FileDescriptorProto) GetDependency() []string { + if m != nil { + return m.Dependency + } + return nil +} + +func (m *FileDescriptorProto) GetPublicDependency() []int32 { + if m != nil { + return m.PublicDependency + } + return nil +} + +func (m *FileDescriptorProto) GetWeakDependency() []int32 { + if m != nil { + return m.WeakDependency + } + return nil +} + +func (m *FileDescriptorProto) GetMessageType() []*DescriptorProto { + if m != nil { + return m.MessageType + } + return nil +} + +func (m *FileDescriptorProto) GetEnumType() []*EnumDescriptorProto { + if m != nil { + return m.EnumType + } + return nil +} + +func (m *FileDescriptorProto) GetService() []*ServiceDescriptorProto { + if m != nil { + return m.Service + } + return nil +} + +func (m *FileDescriptorProto) GetExtension() []*FieldDescriptorProto { + if m != nil { + return m.Extension + } + return nil +} + +func (m *FileDescriptorProto) GetOptions() *FileOptions { + if m != nil { + return m.Options + } + return nil +} + +func (m *FileDescriptorProto) GetSourceCodeInfo() *SourceCodeInfo { + if m != nil { + return m.SourceCodeInfo + } + return nil +} + +func (m *FileDescriptorProto) GetSyntax() string { + if m != nil && m.Syntax != nil { + return *m.Syntax + } + return "" +} + +// Describes a message type. +type DescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Field []*FieldDescriptorProto `protobuf:"bytes,2,rep,name=field" json:"field,omitempty"` + Extension []*FieldDescriptorProto `protobuf:"bytes,6,rep,name=extension" json:"extension,omitempty"` + NestedType []*DescriptorProto `protobuf:"bytes,3,rep,name=nested_type,json=nestedType" json:"nested_type,omitempty"` + EnumType []*EnumDescriptorProto `protobuf:"bytes,4,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` + ExtensionRange []*DescriptorProto_ExtensionRange `protobuf:"bytes,5,rep,name=extension_range,json=extensionRange" json:"extension_range,omitempty"` + OneofDecl []*OneofDescriptorProto `protobuf:"bytes,8,rep,name=oneof_decl,json=oneofDecl" json:"oneof_decl,omitempty"` + Options *MessageOptions `protobuf:"bytes,7,opt,name=options" json:"options,omitempty"` + ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DescriptorProto) Reset() { *m = DescriptorProto{} } +func (m *DescriptorProto) String() string { return proto.CompactTextString(m) } +func (*DescriptorProto) ProtoMessage() {} +func (*DescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +func (m *DescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *DescriptorProto) GetField() []*FieldDescriptorProto { + if m != nil { + return m.Field + } + return nil +} + +func (m *DescriptorProto) GetExtension() []*FieldDescriptorProto { + if m != nil { + return m.Extension + } + return nil +} + +func (m *DescriptorProto) GetNestedType() []*DescriptorProto { + if m != nil { + return m.NestedType + } + return nil +} + +func (m *DescriptorProto) GetEnumType() []*EnumDescriptorProto { + if m != nil { + return m.EnumType + } + return nil +} + +func (m *DescriptorProto) GetExtensionRange() []*DescriptorProto_ExtensionRange { + if m != nil { + return m.ExtensionRange + } + return nil +} + +func (m *DescriptorProto) GetOneofDecl() []*OneofDescriptorProto { + if m != nil { + return m.OneofDecl + } + return nil +} + +func (m *DescriptorProto) GetOptions() *MessageOptions { + if m != nil { + return m.Options + } + return nil +} + +func (m *DescriptorProto) GetReservedRange() []*DescriptorProto_ReservedRange { + if m != nil { + return m.ReservedRange + } + return nil +} + +func (m *DescriptorProto) GetReservedName() []string { + if m != nil { + return m.ReservedName + } + return nil +} + +type DescriptorProto_ExtensionRange struct { + Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DescriptorProto_ExtensionRange) Reset() { *m = DescriptorProto_ExtensionRange{} } +func (m *DescriptorProto_ExtensionRange) String() string { return proto.CompactTextString(m) } +func (*DescriptorProto_ExtensionRange) ProtoMessage() {} +func (*DescriptorProto_ExtensionRange) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{2, 0} +} + +func (m *DescriptorProto_ExtensionRange) GetStart() int32 { + if m != nil && m.Start != nil { + return *m.Start + } + return 0 +} + +func (m *DescriptorProto_ExtensionRange) GetEnd() int32 { + if m != nil && m.End != nil { + return *m.End + } + return 0 +} + +// Range of reserved tag numbers. Reserved tag numbers may not be used by +// fields or extension ranges in the same message. Reserved ranges may +// not overlap. +type DescriptorProto_ReservedRange struct { + Start *int32 `protobuf:"varint,1,opt,name=start" json:"start,omitempty"` + End *int32 `protobuf:"varint,2,opt,name=end" json:"end,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *DescriptorProto_ReservedRange) Reset() { *m = DescriptorProto_ReservedRange{} } +func (m *DescriptorProto_ReservedRange) String() string { return proto.CompactTextString(m) } +func (*DescriptorProto_ReservedRange) ProtoMessage() {} +func (*DescriptorProto_ReservedRange) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{2, 1} +} + +func (m *DescriptorProto_ReservedRange) GetStart() int32 { + if m != nil && m.Start != nil { + return *m.Start + } + return 0 +} + +func (m *DescriptorProto_ReservedRange) GetEnd() int32 { + if m != nil && m.End != nil { + return *m.End + } + return 0 +} + +// Describes a field within a message. +type FieldDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Number *int32 `protobuf:"varint,3,opt,name=number" json:"number,omitempty"` + Label *FieldDescriptorProto_Label `protobuf:"varint,4,opt,name=label,enum=google.protobuf.FieldDescriptorProto_Label" json:"label,omitempty"` + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + Type *FieldDescriptorProto_Type `protobuf:"varint,5,opt,name=type,enum=google.protobuf.FieldDescriptorProto_Type" json:"type,omitempty"` + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + TypeName *string `protobuf:"bytes,6,opt,name=type_name,json=typeName" json:"type_name,omitempty"` + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + Extendee *string `protobuf:"bytes,2,opt,name=extendee" json:"extendee,omitempty"` + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + DefaultValue *string `protobuf:"bytes,7,opt,name=default_value,json=defaultValue" json:"default_value,omitempty"` + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + OneofIndex *int32 `protobuf:"varint,9,opt,name=oneof_index,json=oneofIndex" json:"oneof_index,omitempty"` + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + JsonName *string `protobuf:"bytes,10,opt,name=json_name,json=jsonName" json:"json_name,omitempty"` + Options *FieldOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FieldDescriptorProto) Reset() { *m = FieldDescriptorProto{} } +func (m *FieldDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*FieldDescriptorProto) ProtoMessage() {} +func (*FieldDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +func (m *FieldDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *FieldDescriptorProto) GetNumber() int32 { + if m != nil && m.Number != nil { + return *m.Number + } + return 0 +} + +func (m *FieldDescriptorProto) GetLabel() FieldDescriptorProto_Label { + if m != nil && m.Label != nil { + return *m.Label + } + return FieldDescriptorProto_LABEL_OPTIONAL +} + +func (m *FieldDescriptorProto) GetType() FieldDescriptorProto_Type { + if m != nil && m.Type != nil { + return *m.Type + } + return FieldDescriptorProto_TYPE_DOUBLE +} + +func (m *FieldDescriptorProto) GetTypeName() string { + if m != nil && m.TypeName != nil { + return *m.TypeName + } + return "" +} + +func (m *FieldDescriptorProto) GetExtendee() string { + if m != nil && m.Extendee != nil { + return *m.Extendee + } + return "" +} + +func (m *FieldDescriptorProto) GetDefaultValue() string { + if m != nil && m.DefaultValue != nil { + return *m.DefaultValue + } + return "" +} + +func (m *FieldDescriptorProto) GetOneofIndex() int32 { + if m != nil && m.OneofIndex != nil { + return *m.OneofIndex + } + return 0 +} + +func (m *FieldDescriptorProto) GetJsonName() string { + if m != nil && m.JsonName != nil { + return *m.JsonName + } + return "" +} + +func (m *FieldDescriptorProto) GetOptions() *FieldOptions { + if m != nil { + return m.Options + } + return nil +} + +// Describes a oneof. +type OneofDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Options *OneofOptions `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OneofDescriptorProto) Reset() { *m = OneofDescriptorProto{} } +func (m *OneofDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*OneofDescriptorProto) ProtoMessage() {} +func (*OneofDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +func (m *OneofDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *OneofDescriptorProto) GetOptions() *OneofOptions { + if m != nil { + return m.Options + } + return nil +} + +// Describes an enum type. +type EnumDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Value []*EnumValueDescriptorProto `protobuf:"bytes,2,rep,name=value" json:"value,omitempty"` + Options *EnumOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *EnumDescriptorProto) Reset() { *m = EnumDescriptorProto{} } +func (m *EnumDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*EnumDescriptorProto) ProtoMessage() {} +func (*EnumDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +func (m *EnumDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *EnumDescriptorProto) GetValue() []*EnumValueDescriptorProto { + if m != nil { + return m.Value + } + return nil +} + +func (m *EnumDescriptorProto) GetOptions() *EnumOptions { + if m != nil { + return m.Options + } + return nil +} + +// Describes a value within an enum. +type EnumValueDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Number *int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` + Options *EnumValueOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *EnumValueDescriptorProto) Reset() { *m = EnumValueDescriptorProto{} } +func (m *EnumValueDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*EnumValueDescriptorProto) ProtoMessage() {} +func (*EnumValueDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +func (m *EnumValueDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *EnumValueDescriptorProto) GetNumber() int32 { + if m != nil && m.Number != nil { + return *m.Number + } + return 0 +} + +func (m *EnumValueDescriptorProto) GetOptions() *EnumValueOptions { + if m != nil { + return m.Options + } + return nil +} + +// Describes a service. +type ServiceDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + Method []*MethodDescriptorProto `protobuf:"bytes,2,rep,name=method" json:"method,omitempty"` + Options *ServiceOptions `protobuf:"bytes,3,opt,name=options" json:"options,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *ServiceDescriptorProto) Reset() { *m = ServiceDescriptorProto{} } +func (m *ServiceDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*ServiceDescriptorProto) ProtoMessage() {} +func (*ServiceDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func (m *ServiceDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *ServiceDescriptorProto) GetMethod() []*MethodDescriptorProto { + if m != nil { + return m.Method + } + return nil +} + +func (m *ServiceDescriptorProto) GetOptions() *ServiceOptions { + if m != nil { + return m.Options + } + return nil +} + +// Describes a method of a service. +type MethodDescriptorProto struct { + Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + InputType *string `protobuf:"bytes,2,opt,name=input_type,json=inputType" json:"input_type,omitempty"` + OutputType *string `protobuf:"bytes,3,opt,name=output_type,json=outputType" json:"output_type,omitempty"` + Options *MethodOptions `protobuf:"bytes,4,opt,name=options" json:"options,omitempty"` + // Identifies if client streams multiple client messages + ClientStreaming *bool `protobuf:"varint,5,opt,name=client_streaming,json=clientStreaming,def=0" json:"client_streaming,omitempty"` + // Identifies if server streams multiple server messages + ServerStreaming *bool `protobuf:"varint,6,opt,name=server_streaming,json=serverStreaming,def=0" json:"server_streaming,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MethodDescriptorProto) Reset() { *m = MethodDescriptorProto{} } +func (m *MethodDescriptorProto) String() string { return proto.CompactTextString(m) } +func (*MethodDescriptorProto) ProtoMessage() {} +func (*MethodDescriptorProto) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } + +const Default_MethodDescriptorProto_ClientStreaming bool = false +const Default_MethodDescriptorProto_ServerStreaming bool = false + +func (m *MethodDescriptorProto) GetName() string { + if m != nil && m.Name != nil { + return *m.Name + } + return "" +} + +func (m *MethodDescriptorProto) GetInputType() string { + if m != nil && m.InputType != nil { + return *m.InputType + } + return "" +} + +func (m *MethodDescriptorProto) GetOutputType() string { + if m != nil && m.OutputType != nil { + return *m.OutputType + } + return "" +} + +func (m *MethodDescriptorProto) GetOptions() *MethodOptions { + if m != nil { + return m.Options + } + return nil +} + +func (m *MethodDescriptorProto) GetClientStreaming() bool { + if m != nil && m.ClientStreaming != nil { + return *m.ClientStreaming + } + return Default_MethodDescriptorProto_ClientStreaming +} + +func (m *MethodDescriptorProto) GetServerStreaming() bool { + if m != nil && m.ServerStreaming != nil { + return *m.ServerStreaming + } + return Default_MethodDescriptorProto_ServerStreaming +} + +type FileOptions struct { + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + JavaPackage *string `protobuf:"bytes,1,opt,name=java_package,json=javaPackage" json:"java_package,omitempty"` + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + JavaOuterClassname *string `protobuf:"bytes,8,opt,name=java_outer_classname,json=javaOuterClassname" json:"java_outer_classname,omitempty"` + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + JavaMultipleFiles *bool `protobuf:"varint,10,opt,name=java_multiple_files,json=javaMultipleFiles,def=0" json:"java_multiple_files,omitempty"` + // If set true, then the Java code generator will generate equals() and + // hashCode() methods for all messages defined in the .proto file. + // This increases generated code size, potentially substantially for large + // protos, which may harm a memory-constrained application. + // - In the full runtime this is a speed optimization, as the + // AbstractMessage base class includes reflection-based implementations of + // these methods. + // - In the lite runtime, setting this option changes the semantics of + // equals() and hashCode() to more closely match those of the full runtime; + // the generated methods compute their results based on field values rather + // than object identity. (Implementations should not assume that hashcodes + // will be consistent across runtimes or versions of the protocol compiler.) + JavaGenerateEqualsAndHash *bool `protobuf:"varint,20,opt,name=java_generate_equals_and_hash,json=javaGenerateEqualsAndHash,def=0" json:"java_generate_equals_and_hash,omitempty"` + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + JavaStringCheckUtf8 *bool `protobuf:"varint,27,opt,name=java_string_check_utf8,json=javaStringCheckUtf8,def=0" json:"java_string_check_utf8,omitempty"` + OptimizeFor *FileOptions_OptimizeMode `protobuf:"varint,9,opt,name=optimize_for,json=optimizeFor,enum=google.protobuf.FileOptions_OptimizeMode,def=1" json:"optimize_for,omitempty"` + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + GoPackage *string `protobuf:"bytes,11,opt,name=go_package,json=goPackage" json:"go_package,omitempty"` + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + CcGenericServices *bool `protobuf:"varint,16,opt,name=cc_generic_services,json=ccGenericServices,def=0" json:"cc_generic_services,omitempty"` + JavaGenericServices *bool `protobuf:"varint,17,opt,name=java_generic_services,json=javaGenericServices,def=0" json:"java_generic_services,omitempty"` + PyGenericServices *bool `protobuf:"varint,18,opt,name=py_generic_services,json=pyGenericServices,def=0" json:"py_generic_services,omitempty"` + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + Deprecated *bool `protobuf:"varint,23,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + CcEnableArenas *bool `protobuf:"varint,31,opt,name=cc_enable_arenas,json=ccEnableArenas,def=0" json:"cc_enable_arenas,omitempty"` + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + ObjcClassPrefix *string `protobuf:"bytes,36,opt,name=objc_class_prefix,json=objcClassPrefix" json:"objc_class_prefix,omitempty"` + // Namespace for generated classes; defaults to the package. + CsharpNamespace *string `protobuf:"bytes,37,opt,name=csharp_namespace,json=csharpNamespace" json:"csharp_namespace,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FileOptions) Reset() { *m = FileOptions{} } +func (m *FileOptions) String() string { return proto.CompactTextString(m) } +func (*FileOptions) ProtoMessage() {} +func (*FileOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + +var extRange_FileOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*FileOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_FileOptions +} + +const Default_FileOptions_JavaMultipleFiles bool = false +const Default_FileOptions_JavaGenerateEqualsAndHash bool = false +const Default_FileOptions_JavaStringCheckUtf8 bool = false +const Default_FileOptions_OptimizeFor FileOptions_OptimizeMode = FileOptions_SPEED +const Default_FileOptions_CcGenericServices bool = false +const Default_FileOptions_JavaGenericServices bool = false +const Default_FileOptions_PyGenericServices bool = false +const Default_FileOptions_Deprecated bool = false +const Default_FileOptions_CcEnableArenas bool = false + +func (m *FileOptions) GetJavaPackage() string { + if m != nil && m.JavaPackage != nil { + return *m.JavaPackage + } + return "" +} + +func (m *FileOptions) GetJavaOuterClassname() string { + if m != nil && m.JavaOuterClassname != nil { + return *m.JavaOuterClassname + } + return "" +} + +func (m *FileOptions) GetJavaMultipleFiles() bool { + if m != nil && m.JavaMultipleFiles != nil { + return *m.JavaMultipleFiles + } + return Default_FileOptions_JavaMultipleFiles +} + +func (m *FileOptions) GetJavaGenerateEqualsAndHash() bool { + if m != nil && m.JavaGenerateEqualsAndHash != nil { + return *m.JavaGenerateEqualsAndHash + } + return Default_FileOptions_JavaGenerateEqualsAndHash +} + +func (m *FileOptions) GetJavaStringCheckUtf8() bool { + if m != nil && m.JavaStringCheckUtf8 != nil { + return *m.JavaStringCheckUtf8 + } + return Default_FileOptions_JavaStringCheckUtf8 +} + +func (m *FileOptions) GetOptimizeFor() FileOptions_OptimizeMode { + if m != nil && m.OptimizeFor != nil { + return *m.OptimizeFor + } + return Default_FileOptions_OptimizeFor +} + +func (m *FileOptions) GetGoPackage() string { + if m != nil && m.GoPackage != nil { + return *m.GoPackage + } + return "" +} + +func (m *FileOptions) GetCcGenericServices() bool { + if m != nil && m.CcGenericServices != nil { + return *m.CcGenericServices + } + return Default_FileOptions_CcGenericServices +} + +func (m *FileOptions) GetJavaGenericServices() bool { + if m != nil && m.JavaGenericServices != nil { + return *m.JavaGenericServices + } + return Default_FileOptions_JavaGenericServices +} + +func (m *FileOptions) GetPyGenericServices() bool { + if m != nil && m.PyGenericServices != nil { + return *m.PyGenericServices + } + return Default_FileOptions_PyGenericServices +} + +func (m *FileOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_FileOptions_Deprecated +} + +func (m *FileOptions) GetCcEnableArenas() bool { + if m != nil && m.CcEnableArenas != nil { + return *m.CcEnableArenas + } + return Default_FileOptions_CcEnableArenas +} + +func (m *FileOptions) GetObjcClassPrefix() string { + if m != nil && m.ObjcClassPrefix != nil { + return *m.ObjcClassPrefix + } + return "" +} + +func (m *FileOptions) GetCsharpNamespace() string { + if m != nil && m.CsharpNamespace != nil { + return *m.CsharpNamespace + } + return "" +} + +func (m *FileOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type MessageOptions struct { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + MessageSetWireFormat *bool `protobuf:"varint,1,opt,name=message_set_wire_format,json=messageSetWireFormat,def=0" json:"message_set_wire_format,omitempty"` + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + NoStandardDescriptorAccessor *bool `protobuf:"varint,2,opt,name=no_standard_descriptor_accessor,json=noStandardDescriptorAccessor,def=0" json:"no_standard_descriptor_accessor,omitempty"` + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementions still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + MapEntry *bool `protobuf:"varint,7,opt,name=map_entry,json=mapEntry" json:"map_entry,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MessageOptions) Reset() { *m = MessageOptions{} } +func (m *MessageOptions) String() string { return proto.CompactTextString(m) } +func (*MessageOptions) ProtoMessage() {} +func (*MessageOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } + +var extRange_MessageOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*MessageOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MessageOptions +} + +const Default_MessageOptions_MessageSetWireFormat bool = false +const Default_MessageOptions_NoStandardDescriptorAccessor bool = false +const Default_MessageOptions_Deprecated bool = false + +func (m *MessageOptions) GetMessageSetWireFormat() bool { + if m != nil && m.MessageSetWireFormat != nil { + return *m.MessageSetWireFormat + } + return Default_MessageOptions_MessageSetWireFormat +} + +func (m *MessageOptions) GetNoStandardDescriptorAccessor() bool { + if m != nil && m.NoStandardDescriptorAccessor != nil { + return *m.NoStandardDescriptorAccessor + } + return Default_MessageOptions_NoStandardDescriptorAccessor +} + +func (m *MessageOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_MessageOptions_Deprecated +} + +func (m *MessageOptions) GetMapEntry() bool { + if m != nil && m.MapEntry != nil { + return *m.MapEntry + } + return false +} + +func (m *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type FieldOptions struct { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + Ctype *FieldOptions_CType `protobuf:"varint,1,opt,name=ctype,enum=google.protobuf.FieldOptions_CType,def=0" json:"ctype,omitempty"` + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). By default these types are + // represented as JavaScript strings. This avoids loss of precision that can + // happen when a large value is converted to a floating point JavaScript + // numbers. Specifying JS_NUMBER for the jstype causes the generated + // JavaScript code to use the JavaScript "number" type instead of strings. + // This option is an enum to permit additional types to be added, + // e.g. goog.math.Integer. + Jstype *FieldOptions_JSType `protobuf:"varint,6,opt,name=jstype,enum=google.protobuf.FieldOptions_JSType,def=0" json:"jstype,omitempty"` + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outher message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + Lazy *bool `protobuf:"varint,5,opt,name=lazy,def=0" json:"lazy,omitempty"` + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // For Google-internal migration only. Do not use. + Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *FieldOptions) Reset() { *m = FieldOptions{} } +func (m *FieldOptions) String() string { return proto.CompactTextString(m) } +func (*FieldOptions) ProtoMessage() {} +func (*FieldOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } + +var extRange_FieldOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*FieldOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_FieldOptions +} + +const Default_FieldOptions_Ctype FieldOptions_CType = FieldOptions_STRING +const Default_FieldOptions_Jstype FieldOptions_JSType = FieldOptions_JS_NORMAL +const Default_FieldOptions_Lazy bool = false +const Default_FieldOptions_Deprecated bool = false +const Default_FieldOptions_Weak bool = false + +func (m *FieldOptions) GetCtype() FieldOptions_CType { + if m != nil && m.Ctype != nil { + return *m.Ctype + } + return Default_FieldOptions_Ctype +} + +func (m *FieldOptions) GetPacked() bool { + if m != nil && m.Packed != nil { + return *m.Packed + } + return false +} + +func (m *FieldOptions) GetJstype() FieldOptions_JSType { + if m != nil && m.Jstype != nil { + return *m.Jstype + } + return Default_FieldOptions_Jstype +} + +func (m *FieldOptions) GetLazy() bool { + if m != nil && m.Lazy != nil { + return *m.Lazy + } + return Default_FieldOptions_Lazy +} + +func (m *FieldOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_FieldOptions_Deprecated +} + +func (m *FieldOptions) GetWeak() bool { + if m != nil && m.Weak != nil { + return *m.Weak + } + return Default_FieldOptions_Weak +} + +func (m *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type OneofOptions struct { + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *OneofOptions) Reset() { *m = OneofOptions{} } +func (m *OneofOptions) String() string { return proto.CompactTextString(m) } +func (*OneofOptions) ProtoMessage() {} +func (*OneofOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } + +var extRange_OneofOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*OneofOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_OneofOptions +} + +func (m *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type EnumOptions struct { + // Set this option to true to allow mapping different tag names to the same + // value. + AllowAlias *bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias" json:"allow_alias,omitempty"` + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *EnumOptions) Reset() { *m = EnumOptions{} } +func (m *EnumOptions) String() string { return proto.CompactTextString(m) } +func (*EnumOptions) ProtoMessage() {} +func (*EnumOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } + +var extRange_EnumOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*EnumOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_EnumOptions +} + +const Default_EnumOptions_Deprecated bool = false + +func (m *EnumOptions) GetAllowAlias() bool { + if m != nil && m.AllowAlias != nil { + return *m.AllowAlias + } + return false +} + +func (m *EnumOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_EnumOptions_Deprecated +} + +func (m *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type EnumValueOptions struct { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *EnumValueOptions) Reset() { *m = EnumValueOptions{} } +func (m *EnumValueOptions) String() string { return proto.CompactTextString(m) } +func (*EnumValueOptions) ProtoMessage() {} +func (*EnumValueOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } + +var extRange_EnumValueOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*EnumValueOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_EnumValueOptions +} + +const Default_EnumValueOptions_Deprecated bool = false + +func (m *EnumValueOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_EnumValueOptions_Deprecated +} + +func (m *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type ServiceOptions struct { + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *ServiceOptions) Reset() { *m = ServiceOptions{} } +func (m *ServiceOptions) String() string { return proto.CompactTextString(m) } +func (*ServiceOptions) ProtoMessage() {} +func (*ServiceOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } + +var extRange_ServiceOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*ServiceOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_ServiceOptions +} + +const Default_ServiceOptions_Deprecated bool = false + +func (m *ServiceOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_ServiceOptions_Deprecated +} + +func (m *ServiceOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +type MethodOptions struct { + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // The parser stores options it doesn't recognize here. See above. + UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` + proto.XXX_InternalExtensions `json:"-"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *MethodOptions) Reset() { *m = MethodOptions{} } +func (m *MethodOptions) String() string { return proto.CompactTextString(m) } +func (*MethodOptions) ProtoMessage() {} +func (*MethodOptions) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } + +var extRange_MethodOptions = []proto.ExtensionRange{ + {1000, 536870911}, +} + +func (*MethodOptions) ExtensionRangeArray() []proto.ExtensionRange { + return extRange_MethodOptions +} + +const Default_MethodOptions_Deprecated bool = false + +func (m *MethodOptions) GetDeprecated() bool { + if m != nil && m.Deprecated != nil { + return *m.Deprecated + } + return Default_MethodOptions_Deprecated +} + +func (m *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { + if m != nil { + return m.UninterpretedOption + } + return nil +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +type UninterpretedOption struct { + Name []*UninterpretedOption_NamePart `protobuf:"bytes,2,rep,name=name" json:"name,omitempty"` + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + IdentifierValue *string `protobuf:"bytes,3,opt,name=identifier_value,json=identifierValue" json:"identifier_value,omitempty"` + PositiveIntValue *uint64 `protobuf:"varint,4,opt,name=positive_int_value,json=positiveIntValue" json:"positive_int_value,omitempty"` + NegativeIntValue *int64 `protobuf:"varint,5,opt,name=negative_int_value,json=negativeIntValue" json:"negative_int_value,omitempty"` + DoubleValue *float64 `protobuf:"fixed64,6,opt,name=double_value,json=doubleValue" json:"double_value,omitempty"` + StringValue []byte `protobuf:"bytes,7,opt,name=string_value,json=stringValue" json:"string_value,omitempty"` + AggregateValue *string `protobuf:"bytes,8,opt,name=aggregate_value,json=aggregateValue" json:"aggregate_value,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *UninterpretedOption) Reset() { *m = UninterpretedOption{} } +func (m *UninterpretedOption) String() string { return proto.CompactTextString(m) } +func (*UninterpretedOption) ProtoMessage() {} +func (*UninterpretedOption) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } + +func (m *UninterpretedOption) GetName() []*UninterpretedOption_NamePart { + if m != nil { + return m.Name + } + return nil +} + +func (m *UninterpretedOption) GetIdentifierValue() string { + if m != nil && m.IdentifierValue != nil { + return *m.IdentifierValue + } + return "" +} + +func (m *UninterpretedOption) GetPositiveIntValue() uint64 { + if m != nil && m.PositiveIntValue != nil { + return *m.PositiveIntValue + } + return 0 +} + +func (m *UninterpretedOption) GetNegativeIntValue() int64 { + if m != nil && m.NegativeIntValue != nil { + return *m.NegativeIntValue + } + return 0 +} + +func (m *UninterpretedOption) GetDoubleValue() float64 { + if m != nil && m.DoubleValue != nil { + return *m.DoubleValue + } + return 0 +} + +func (m *UninterpretedOption) GetStringValue() []byte { + if m != nil { + return m.StringValue + } + return nil +} + +func (m *UninterpretedOption) GetAggregateValue() string { + if m != nil && m.AggregateValue != nil { + return *m.AggregateValue + } + return "" +} + +// The name of the uninterpreted option. Each string represents a segment in +// a dot-separated name. is_extension is true iff a segment represents an +// extension (denoted with parentheses in options specs in .proto files). +// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents +// "foo.(bar.baz).qux". +type UninterpretedOption_NamePart struct { + NamePart *string `protobuf:"bytes,1,req,name=name_part,json=namePart" json:"name_part,omitempty"` + IsExtension *bool `protobuf:"varint,2,req,name=is_extension,json=isExtension" json:"is_extension,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *UninterpretedOption_NamePart) Reset() { *m = UninterpretedOption_NamePart{} } +func (m *UninterpretedOption_NamePart) String() string { return proto.CompactTextString(m) } +func (*UninterpretedOption_NamePart) ProtoMessage() {} +func (*UninterpretedOption_NamePart) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{17, 0} +} + +func (m *UninterpretedOption_NamePart) GetNamePart() string { + if m != nil && m.NamePart != nil { + return *m.NamePart + } + return "" +} + +func (m *UninterpretedOption_NamePart) GetIsExtension() bool { + if m != nil && m.IsExtension != nil { + return *m.IsExtension + } + return false +} + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +type SourceCodeInfo struct { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendent. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + Location []*SourceCodeInfo_Location `protobuf:"bytes,1,rep,name=location" json:"location,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SourceCodeInfo) Reset() { *m = SourceCodeInfo{} } +func (m *SourceCodeInfo) String() string { return proto.CompactTextString(m) } +func (*SourceCodeInfo) ProtoMessage() {} +func (*SourceCodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18} } + +func (m *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { + if m != nil { + return m.Location + } + return nil +} + +type SourceCodeInfo_Location struct { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + Span []int32 `protobuf:"varint,2,rep,packed,name=span" json:"span,omitempty"` + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + LeadingComments *string `protobuf:"bytes,3,opt,name=leading_comments,json=leadingComments" json:"leading_comments,omitempty"` + TrailingComments *string `protobuf:"bytes,4,opt,name=trailing_comments,json=trailingComments" json:"trailing_comments,omitempty"` + LeadingDetachedComments []string `protobuf:"bytes,6,rep,name=leading_detached_comments,json=leadingDetachedComments" json:"leading_detached_comments,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *SourceCodeInfo_Location) Reset() { *m = SourceCodeInfo_Location{} } +func (m *SourceCodeInfo_Location) String() string { return proto.CompactTextString(m) } +func (*SourceCodeInfo_Location) ProtoMessage() {} +func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{18, 0} } + +func (m *SourceCodeInfo_Location) GetPath() []int32 { + if m != nil { + return m.Path + } + return nil +} + +func (m *SourceCodeInfo_Location) GetSpan() []int32 { + if m != nil { + return m.Span + } + return nil +} + +func (m *SourceCodeInfo_Location) GetLeadingComments() string { + if m != nil && m.LeadingComments != nil { + return *m.LeadingComments + } + return "" +} + +func (m *SourceCodeInfo_Location) GetTrailingComments() string { + if m != nil && m.TrailingComments != nil { + return *m.TrailingComments + } + return "" +} + +func (m *SourceCodeInfo_Location) GetLeadingDetachedComments() []string { + if m != nil { + return m.LeadingDetachedComments + } + return nil +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +type GeneratedCodeInfo struct { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + Annotation []*GeneratedCodeInfo_Annotation `protobuf:"bytes,1,rep,name=annotation" json:"annotation,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GeneratedCodeInfo) Reset() { *m = GeneratedCodeInfo{} } +func (m *GeneratedCodeInfo) String() string { return proto.CompactTextString(m) } +func (*GeneratedCodeInfo) ProtoMessage() {} +func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{19} } + +func (m *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { + if m != nil { + return m.Annotation + } + return nil +} + +type GeneratedCodeInfo_Annotation struct { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + Path []int32 `protobuf:"varint,1,rep,packed,name=path" json:"path,omitempty"` + // Identifies the filesystem path to the original source .proto. + SourceFile *string `protobuf:"bytes,2,opt,name=source_file,json=sourceFile" json:"source_file,omitempty"` + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + Begin *int32 `protobuf:"varint,3,opt,name=begin" json:"begin,omitempty"` + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + End *int32 `protobuf:"varint,4,opt,name=end" json:"end,omitempty"` + XXX_unrecognized []byte `json:"-"` +} + +func (m *GeneratedCodeInfo_Annotation) Reset() { *m = GeneratedCodeInfo_Annotation{} } +func (m *GeneratedCodeInfo_Annotation) String() string { return proto.CompactTextString(m) } +func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} +func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { + return fileDescriptor1, []int{19, 0} +} + +func (m *GeneratedCodeInfo_Annotation) GetPath() []int32 { + if m != nil { + return m.Path + } + return nil +} + +func (m *GeneratedCodeInfo_Annotation) GetSourceFile() string { + if m != nil && m.SourceFile != nil { + return *m.SourceFile + } + return "" +} + +func (m *GeneratedCodeInfo_Annotation) GetBegin() int32 { + if m != nil && m.Begin != nil { + return *m.Begin + } + return 0 +} + +func (m *GeneratedCodeInfo_Annotation) GetEnd() int32 { + if m != nil && m.End != nil { + return *m.End + } + return 0 +} + +func init() { + proto.RegisterType((*FileDescriptorSet)(nil), "google.protobuf.FileDescriptorSet") + proto.RegisterType((*FileDescriptorProto)(nil), "google.protobuf.FileDescriptorProto") + proto.RegisterType((*DescriptorProto)(nil), "google.protobuf.DescriptorProto") + proto.RegisterType((*DescriptorProto_ExtensionRange)(nil), "google.protobuf.DescriptorProto.ExtensionRange") + proto.RegisterType((*DescriptorProto_ReservedRange)(nil), "google.protobuf.DescriptorProto.ReservedRange") + proto.RegisterType((*FieldDescriptorProto)(nil), "google.protobuf.FieldDescriptorProto") + proto.RegisterType((*OneofDescriptorProto)(nil), "google.protobuf.OneofDescriptorProto") + proto.RegisterType((*EnumDescriptorProto)(nil), "google.protobuf.EnumDescriptorProto") + proto.RegisterType((*EnumValueDescriptorProto)(nil), "google.protobuf.EnumValueDescriptorProto") + proto.RegisterType((*ServiceDescriptorProto)(nil), "google.protobuf.ServiceDescriptorProto") + proto.RegisterType((*MethodDescriptorProto)(nil), "google.protobuf.MethodDescriptorProto") + proto.RegisterType((*FileOptions)(nil), "google.protobuf.FileOptions") + proto.RegisterType((*MessageOptions)(nil), "google.protobuf.MessageOptions") + proto.RegisterType((*FieldOptions)(nil), "google.protobuf.FieldOptions") + proto.RegisterType((*OneofOptions)(nil), "google.protobuf.OneofOptions") + proto.RegisterType((*EnumOptions)(nil), "google.protobuf.EnumOptions") + proto.RegisterType((*EnumValueOptions)(nil), "google.protobuf.EnumValueOptions") + proto.RegisterType((*ServiceOptions)(nil), "google.protobuf.ServiceOptions") + proto.RegisterType((*MethodOptions)(nil), "google.protobuf.MethodOptions") + proto.RegisterType((*UninterpretedOption)(nil), "google.protobuf.UninterpretedOption") + proto.RegisterType((*UninterpretedOption_NamePart)(nil), "google.protobuf.UninterpretedOption.NamePart") + proto.RegisterType((*SourceCodeInfo)(nil), "google.protobuf.SourceCodeInfo") + proto.RegisterType((*SourceCodeInfo_Location)(nil), "google.protobuf.SourceCodeInfo.Location") + proto.RegisterType((*GeneratedCodeInfo)(nil), "google.protobuf.GeneratedCodeInfo") + proto.RegisterType((*GeneratedCodeInfo_Annotation)(nil), "google.protobuf.GeneratedCodeInfo.Annotation") + proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Type", FieldDescriptorProto_Type_name, FieldDescriptorProto_Type_value) + proto.RegisterEnum("google.protobuf.FieldDescriptorProto_Label", FieldDescriptorProto_Label_name, FieldDescriptorProto_Label_value) + proto.RegisterEnum("google.protobuf.FileOptions_OptimizeMode", FileOptions_OptimizeMode_name, FileOptions_OptimizeMode_value) + proto.RegisterEnum("google.protobuf.FieldOptions_CType", FieldOptions_CType_name, FieldOptions_CType_value) + proto.RegisterEnum("google.protobuf.FieldOptions_JSType", FieldOptions_JSType_name, FieldOptions_JSType_value) +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/protobuf/descriptor.proto", fileDescriptor1) +} + +var fileDescriptor1 = []byte{ + // 2282 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x59, 0xcd, 0x8f, 0xdb, 0xc6, + 0x15, 0x2f, 0xf5, 0xb5, 0xd2, 0xd3, 0xae, 0xc4, 0x9d, 0xdd, 0xd8, 0xf2, 0x26, 0x8e, 0x63, 0xc5, + 0x8e, 0x1d, 0xa7, 0xd5, 0x06, 0x6e, 0x3e, 0xdc, 0x4d, 0x91, 0x42, 0x2b, 0xd1, 0x1b, 0x19, 0xd2, + 0x4a, 0xa5, 0xa4, 0x36, 0x49, 0x0f, 0x04, 0x97, 0x1a, 0x69, 0x69, 0x53, 0xa4, 0x4a, 0x52, 0xb6, + 0x37, 0xa7, 0x02, 0x3d, 0xf5, 0xd8, 0x5b, 0xd1, 0x16, 0x45, 0x91, 0x4b, 0x80, 0xfe, 0x01, 0x3d, + 0xf4, 0xde, 0x6b, 0x81, 0xde, 0x7b, 0x2c, 0xd0, 0xfe, 0x07, 0xbd, 0xf6, 0xcd, 0x0c, 0x49, 0x91, + 0xfa, 0x88, 0xb7, 0x01, 0x92, 0xd4, 0x07, 0x5b, 0xf3, 0xe6, 0xf7, 0xde, 0xbc, 0x79, 0xf3, 0x9b, + 0xf7, 0x1e, 0xc7, 0xf0, 0xce, 0xc4, 0x71, 0x26, 0x16, 0xad, 0x4d, 0x1c, 0x4b, 0xb7, 0x27, 0x35, + 0xc7, 0x9d, 0x1c, 0x4e, 0xa8, 0x3d, 0x73, 0x1d, 0xdf, 0x39, 0xe4, 0x7f, 0x9f, 0xcd, 0xc7, 0x87, + 0x23, 0xea, 0x19, 0xae, 0x39, 0xf3, 0x1d, 0xb7, 0xc6, 0x65, 0xa4, 0x1c, 0x68, 0x85, 0x88, 0x6a, + 0x07, 0x76, 0x1f, 0x9a, 0x16, 0x6d, 0x46, 0xc0, 0x3e, 0xf5, 0xc9, 0x03, 0xc8, 0x8c, 0x51, 0x58, + 0x91, 0x5e, 0x4b, 0xdf, 0x2d, 0xde, 0xbf, 0x55, 0x5b, 0x52, 0xaa, 0x25, 0x35, 0x7a, 0x4c, 0xac, + 0x72, 0x8d, 0xea, 0x3f, 0x33, 0xb0, 0xb7, 0x66, 0x96, 0x10, 0xc8, 0xd8, 0xfa, 0x94, 0x59, 0x94, + 0xee, 0x16, 0x54, 0xfe, 0x9b, 0x54, 0x60, 0x6b, 0xa6, 0x1b, 0x4f, 0xf4, 0x09, 0xad, 0xa4, 0xb8, + 0x38, 0x1c, 0x92, 0x57, 0x01, 0x46, 0x74, 0x46, 0xed, 0x11, 0xb5, 0x8d, 0x8b, 0x4a, 0x1a, 0xbd, + 0x28, 0xa8, 0x31, 0x09, 0x79, 0x0b, 0x76, 0x67, 0xf3, 0x33, 0xcb, 0x34, 0xb4, 0x18, 0x0c, 0x10, + 0x96, 0x55, 0x65, 0x31, 0xd1, 0x5c, 0x80, 0xef, 0x40, 0xf9, 0x19, 0xd5, 0x9f, 0xc4, 0xa1, 0x45, + 0x0e, 0x2d, 0x31, 0x71, 0x0c, 0xd8, 0x80, 0xed, 0x29, 0xf5, 0x3c, 0x74, 0x40, 0xf3, 0x2f, 0x66, + 0xb4, 0x92, 0xe1, 0xbb, 0x7f, 0x6d, 0x65, 0xf7, 0xcb, 0x3b, 0x2f, 0x06, 0x5a, 0x03, 0x54, 0x22, + 0x75, 0x28, 0x50, 0x7b, 0x3e, 0x15, 0x16, 0xb2, 0x1b, 0xe2, 0xa7, 0x20, 0x62, 0xd9, 0x4a, 0x9e, + 0xa9, 0x05, 0x26, 0xb6, 0x3c, 0xea, 0x3e, 0x35, 0x0d, 0x5a, 0xc9, 0x71, 0x03, 0x77, 0x56, 0x0c, + 0xf4, 0xc5, 0xfc, 0xb2, 0x8d, 0x50, 0x0f, 0xb7, 0x52, 0xa0, 0xcf, 0x7d, 0x6a, 0x7b, 0xa6, 0x63, + 0x57, 0xb6, 0xb8, 0x91, 0xdb, 0x6b, 0x4e, 0x91, 0x5a, 0xa3, 0x65, 0x13, 0x0b, 0x3d, 0xf2, 0x1e, + 0x6c, 0x39, 0x33, 0x1f, 0x7f, 0x79, 0x95, 0x3c, 0x9e, 0x4f, 0xf1, 0xfe, 0x2b, 0x6b, 0x89, 0xd0, + 0x15, 0x18, 0x35, 0x04, 0x93, 0x16, 0xc8, 0x9e, 0x33, 0x77, 0x0d, 0xaa, 0x19, 0xce, 0x88, 0x6a, + 0xa6, 0x3d, 0x76, 0x2a, 0x05, 0x6e, 0xe0, 0xc6, 0xea, 0x46, 0x38, 0xb0, 0x81, 0xb8, 0x16, 0xc2, + 0xd4, 0x92, 0x97, 0x18, 0x93, 0x2b, 0x90, 0xf3, 0x2e, 0x6c, 0x5f, 0x7f, 0x5e, 0xd9, 0xe6, 0x0c, + 0x09, 0x46, 0xd5, 0xff, 0x64, 0xa1, 0x7c, 0x19, 0x8a, 0x7d, 0x00, 0xd9, 0x31, 0xdb, 0x25, 0x12, + 0xec, 0x7f, 0x88, 0x81, 0xd0, 0x49, 0x06, 0x31, 0xf7, 0x15, 0x83, 0x58, 0x87, 0xa2, 0x4d, 0x3d, + 0x9f, 0x8e, 0x04, 0x23, 0xd2, 0x97, 0xe4, 0x14, 0x08, 0xa5, 0x55, 0x4a, 0x65, 0xbe, 0x12, 0xa5, + 0x3e, 0x86, 0x72, 0xe4, 0x92, 0xe6, 0x62, 0xbe, 0x08, 0xb9, 0x79, 0xf8, 0x22, 0x4f, 0x6a, 0x4a, + 0xa8, 0xa7, 0x32, 0x35, 0xb5, 0x44, 0x13, 0x63, 0xd2, 0x04, 0x70, 0x6c, 0xea, 0x8c, 0xf1, 0x7a, + 0x19, 0x16, 0xf2, 0x64, 0x7d, 0x94, 0xba, 0x0c, 0xb2, 0x12, 0x25, 0x47, 0x48, 0x0d, 0x8b, 0xfc, + 0x60, 0x41, 0xb5, 0xad, 0x0d, 0x4c, 0xe9, 0x88, 0x4b, 0xb6, 0xc2, 0xb6, 0x21, 0x94, 0x5c, 0xca, + 0x78, 0x8f, 0x21, 0x16, 0x3b, 0x2b, 0x70, 0x27, 0x6a, 0x2f, 0xdc, 0x99, 0x1a, 0xa8, 0x89, 0x8d, + 0xed, 0xb8, 0xf1, 0x21, 0x79, 0x1d, 0x22, 0x81, 0xc6, 0x69, 0x05, 0x3c, 0x0b, 0x6d, 0x87, 0xc2, + 0x53, 0x94, 0x1d, 0x3c, 0x80, 0x52, 0x32, 0x3c, 0x64, 0x1f, 0xb2, 0x9e, 0xaf, 0xbb, 0x3e, 0x67, + 0x61, 0x56, 0x15, 0x03, 0x22, 0x43, 0x1a, 0x93, 0x0c, 0xcf, 0x72, 0x59, 0x95, 0xfd, 0x3c, 0x78, + 0x1f, 0x76, 0x12, 0xcb, 0x5f, 0x56, 0xb1, 0xfa, 0x9b, 0x1c, 0xec, 0xaf, 0xe3, 0xdc, 0x5a, 0xfa, + 0xe3, 0xf5, 0x41, 0x06, 0x9c, 0x51, 0x17, 0x79, 0xc7, 0x2c, 0x04, 0x23, 0x64, 0x54, 0xd6, 0xd2, + 0xcf, 0xa8, 0x85, 0x6c, 0x92, 0xee, 0x96, 0xee, 0xbf, 0x75, 0x29, 0x56, 0xd7, 0xda, 0x4c, 0x45, + 0x15, 0x9a, 0xe4, 0x43, 0xc8, 0x04, 0x29, 0x8e, 0x59, 0xb8, 0x77, 0x39, 0x0b, 0x8c, 0x8b, 0x2a, + 0xd7, 0x23, 0x2f, 0x43, 0x81, 0xfd, 0x2b, 0x62, 0x9b, 0xe3, 0x3e, 0xe7, 0x99, 0x80, 0xc5, 0x95, + 0x1c, 0x40, 0x9e, 0xd3, 0x6c, 0x44, 0xc3, 0xd2, 0x10, 0x8d, 0xd9, 0xc1, 0x8c, 0xe8, 0x58, 0x9f, + 0x5b, 0xbe, 0xf6, 0x54, 0xb7, 0xe6, 0x94, 0x13, 0x06, 0x0f, 0x26, 0x10, 0xfe, 0x84, 0xc9, 0xc8, + 0x0d, 0x28, 0x0a, 0x56, 0x9a, 0xa8, 0xf3, 0x9c, 0x67, 0x9f, 0xac, 0x2a, 0x88, 0xda, 0x62, 0x12, + 0xb6, 0xfc, 0x63, 0x0f, 0xef, 0x42, 0x70, 0xb4, 0x7c, 0x09, 0x26, 0xe0, 0xcb, 0xbf, 0xbf, 0x9c, + 0xf8, 0xae, 0xaf, 0xdf, 0xde, 0x32, 0x17, 0xab, 0x7f, 0x4e, 0x41, 0x86, 0xdf, 0xb7, 0x32, 0x14, + 0x07, 0x9f, 0xf4, 0x14, 0xad, 0xd9, 0x1d, 0x1e, 0xb7, 0x15, 0x59, 0x22, 0x25, 0x00, 0x2e, 0x78, + 0xd8, 0xee, 0xd6, 0x07, 0x72, 0x2a, 0x1a, 0xb7, 0x4e, 0x07, 0xef, 0xbd, 0x23, 0xa7, 0x23, 0x85, + 0xa1, 0x10, 0x64, 0xe2, 0x80, 0xef, 0xdf, 0x97, 0xb3, 0xc8, 0x84, 0x6d, 0x61, 0xa0, 0xf5, 0xb1, + 0xd2, 0x44, 0x44, 0x2e, 0x29, 0x41, 0xcc, 0x16, 0xd9, 0x81, 0x02, 0x97, 0x1c, 0x77, 0xbb, 0x6d, + 0x39, 0x1f, 0xd9, 0xec, 0x0f, 0xd4, 0xd6, 0xe9, 0x89, 0x5c, 0x88, 0x6c, 0x9e, 0xa8, 0xdd, 0x61, + 0x4f, 0x86, 0xc8, 0x42, 0x47, 0xe9, 0xf7, 0xeb, 0x27, 0x8a, 0x5c, 0x8c, 0x10, 0xc7, 0x9f, 0x0c, + 0x94, 0xbe, 0xbc, 0x9d, 0x70, 0x0b, 0x97, 0xd8, 0x89, 0x96, 0x50, 0x4e, 0x87, 0x1d, 0xb9, 0x44, + 0x76, 0x61, 0x47, 0x2c, 0x11, 0x3a, 0x51, 0x5e, 0x12, 0xa1, 0xa7, 0xf2, 0xc2, 0x11, 0x61, 0x65, + 0x37, 0x21, 0x40, 0x04, 0xa9, 0x36, 0x20, 0xcb, 0xd9, 0x85, 0x2c, 0x2e, 0xb5, 0xeb, 0xc7, 0x4a, + 0x5b, 0xeb, 0xf6, 0x06, 0xad, 0xee, 0x69, 0xbd, 0x8d, 0xb1, 0x8b, 0x64, 0xaa, 0xf2, 0xe3, 0x61, + 0x4b, 0x55, 0x9a, 0x18, 0xbf, 0x98, 0xac, 0xa7, 0xd4, 0x07, 0x28, 0x4b, 0x57, 0x0d, 0xd8, 0x5f, + 0x97, 0x67, 0xd6, 0xde, 0x8c, 0xd8, 0x11, 0xa7, 0x36, 0x1c, 0x31, 0xb7, 0xb5, 0x72, 0xc4, 0x9f, + 0x4b, 0xb0, 0xb7, 0x26, 0xd7, 0xae, 0x5d, 0xe4, 0x47, 0x90, 0x15, 0x14, 0x15, 0xd5, 0xe7, 0xcd, + 0xb5, 0x49, 0x9b, 0x13, 0x76, 0xa5, 0x02, 0x71, 0xbd, 0x78, 0x05, 0x4e, 0x6f, 0xa8, 0xc0, 0xcc, + 0xc4, 0x8a, 0x93, 0xbf, 0x94, 0xa0, 0xb2, 0xc9, 0xf6, 0x0b, 0x12, 0x45, 0x2a, 0x91, 0x28, 0x3e, + 0x58, 0x76, 0xe0, 0xe6, 0xe6, 0x3d, 0xac, 0x78, 0xf1, 0x85, 0x04, 0x57, 0xd6, 0x37, 0x2a, 0x6b, + 0x7d, 0xf8, 0x10, 0x72, 0x53, 0xea, 0x9f, 0x3b, 0x61, 0xb1, 0x7e, 0x63, 0x4d, 0x09, 0x60, 0xd3, + 0xcb, 0xb1, 0x0a, 0xb4, 0xe2, 0x35, 0x24, 0xbd, 0xa9, 0xdb, 0x10, 0xde, 0xac, 0x78, 0xfa, 0xab, + 0x14, 0xbc, 0xb4, 0xd6, 0xf8, 0x5a, 0x47, 0xaf, 0x03, 0x98, 0xf6, 0x6c, 0xee, 0x8b, 0x82, 0x2c, + 0xf2, 0x53, 0x81, 0x4b, 0xf8, 0xdd, 0x67, 0xb9, 0x67, 0xee, 0x47, 0xf3, 0x69, 0x3e, 0x0f, 0x42, + 0xc4, 0x01, 0x0f, 0x16, 0x8e, 0x66, 0xb8, 0xa3, 0xaf, 0x6e, 0xd8, 0xe9, 0x4a, 0xad, 0x7b, 0x1b, + 0x64, 0xc3, 0x32, 0xa9, 0xed, 0x6b, 0x9e, 0xef, 0x52, 0x7d, 0x6a, 0xda, 0x13, 0x9e, 0x80, 0xf3, + 0x47, 0xd9, 0xb1, 0x6e, 0x79, 0x54, 0x2d, 0x8b, 0xe9, 0x7e, 0x38, 0xcb, 0x34, 0x78, 0x95, 0x71, + 0x63, 0x1a, 0xb9, 0x84, 0x86, 0x98, 0x8e, 0x34, 0xaa, 0xbf, 0xde, 0x82, 0x62, 0xac, 0xad, 0x23, + 0x37, 0x61, 0xfb, 0xb1, 0xfe, 0x54, 0xd7, 0xc2, 0x56, 0x5d, 0x44, 0xa2, 0xc8, 0x64, 0xbd, 0xa0, + 0x5d, 0x7f, 0x1b, 0xf6, 0x39, 0x04, 0xf7, 0x88, 0x0b, 0x19, 0x96, 0xee, 0x79, 0x3c, 0x68, 0x79, + 0x0e, 0x25, 0x6c, 0xae, 0xcb, 0xa6, 0x1a, 0xe1, 0x0c, 0x79, 0x17, 0xf6, 0xb8, 0xc6, 0x14, 0x33, + 0xb6, 0x39, 0xb3, 0xa8, 0xc6, 0x3e, 0x1e, 0x3c, 0x9e, 0x88, 0x23, 0xcf, 0x76, 0x19, 0xa2, 0x13, + 0x00, 0x98, 0x47, 0x1e, 0x39, 0x81, 0xeb, 0x5c, 0x0d, 0x3f, 0x74, 0xa8, 0xab, 0xfb, 0x54, 0xa3, + 0x3f, 0x9f, 0x23, 0x56, 0xd3, 0xed, 0x91, 0x76, 0xae, 0x7b, 0xe7, 0x95, 0xfd, 0xb8, 0x81, 0x6b, + 0x0c, 0x7b, 0x12, 0x40, 0x15, 0x8e, 0xac, 0xdb, 0xa3, 0x8f, 0x10, 0x47, 0x8e, 0xe0, 0x0a, 0x37, + 0x84, 0x41, 0xc1, 0x3d, 0x6b, 0xc6, 0x39, 0x35, 0x9e, 0x68, 0x73, 0x7f, 0xfc, 0xa0, 0xf2, 0x72, + 0xdc, 0x02, 0x77, 0xb2, 0xcf, 0x31, 0x0d, 0x06, 0x19, 0x22, 0x82, 0xf4, 0x61, 0x9b, 0x9d, 0xc7, + 0xd4, 0xfc, 0x0c, 0xdd, 0x76, 0x5c, 0x5e, 0x5c, 0x4a, 0x6b, 0x2e, 0x77, 0x2c, 0x88, 0xb5, 0x6e, + 0xa0, 0xd0, 0xc1, 0xc6, 0xf6, 0x28, 0xdb, 0xef, 0x29, 0x4a, 0x53, 0x2d, 0x86, 0x56, 0x1e, 0x3a, + 0x2e, 0xe3, 0xd4, 0xc4, 0x89, 0x62, 0x5c, 0x14, 0x9c, 0x9a, 0x38, 0x61, 0x84, 0x31, 0x5e, 0x86, + 0x21, 0xb6, 0x8d, 0x1f, 0x3d, 0x41, 0x97, 0xef, 0x55, 0xe4, 0x44, 0xbc, 0x0c, 0xe3, 0x44, 0x00, + 0x02, 0x9a, 0x7b, 0x78, 0x25, 0x5e, 0x5a, 0xc4, 0x2b, 0xae, 0xb8, 0xbb, 0xb2, 0xcb, 0x65, 0x55, + 0x5c, 0x71, 0x76, 0xb1, 0xaa, 0x48, 0x12, 0x2b, 0xce, 0x2e, 0x96, 0xd5, 0x6e, 0xf3, 0x2f, 0x37, + 0x97, 0x1a, 0x18, 0xf2, 0x51, 0xe5, 0x6a, 0x1c, 0x1d, 0x9b, 0x20, 0x87, 0x48, 0x64, 0x43, 0xa3, + 0xb6, 0x7e, 0x86, 0x67, 0xaf, 0xbb, 0xf8, 0xc3, 0xab, 0xdc, 0x88, 0x83, 0x4b, 0x86, 0xa1, 0xf0, + 0xd9, 0x3a, 0x9f, 0x24, 0xf7, 0x60, 0xd7, 0x39, 0x7b, 0x6c, 0x08, 0x72, 0x69, 0x68, 0x67, 0x6c, + 0x3e, 0xaf, 0xdc, 0xe2, 0x61, 0x2a, 0xb3, 0x09, 0x4e, 0xad, 0x1e, 0x17, 0x93, 0x37, 0xd1, 0xb8, + 0x77, 0xae, 0xbb, 0x33, 0x5e, 0xdd, 0x3d, 0x0c, 0x2a, 0xad, 0xdc, 0x16, 0x50, 0x21, 0x3f, 0x0d, + 0xc5, 0xd8, 0x17, 0xef, 0xcf, 0x6d, 0xd3, 0x46, 0x6e, 0xa2, 0x49, 0xd6, 0xa4, 0x8b, 0x9b, 0x56, + 0xf9, 0xd7, 0xd6, 0x86, 0x36, 0x7b, 0x18, 0x47, 0x8b, 0xd3, 0x55, 0xf7, 0xe6, 0xab, 0xc2, 0xea, + 0x11, 0x6c, 0xc7, 0x0f, 0x9d, 0x14, 0x40, 0x1c, 0x3b, 0xd6, 0x33, 0xac, 0xa1, 0x8d, 0x6e, 0x93, + 0x55, 0xbf, 0x4f, 0x15, 0x2c, 0x65, 0x58, 0x85, 0xdb, 0xad, 0x81, 0xa2, 0xa9, 0xc3, 0xd3, 0x41, + 0xab, 0xa3, 0xc8, 0xe9, 0x7b, 0x85, 0xfc, 0xbf, 0xb7, 0xe4, 0x5f, 0xe0, 0x9f, 0xd4, 0xa3, 0x4c, + 0xfe, 0x0d, 0xf9, 0x4e, 0xf5, 0xaf, 0x29, 0x28, 0x25, 0xfb, 0x5f, 0xf2, 0x43, 0xb8, 0x1a, 0x7e, + 0xac, 0x7a, 0xd4, 0xd7, 0x9e, 0x99, 0x2e, 0x67, 0xe3, 0x54, 0x17, 0x1d, 0x64, 0x14, 0xc8, 0xfd, + 0x00, 0x85, 0x9f, 0xf5, 0x3f, 0x45, 0xcc, 0x43, 0x0e, 0x21, 0x6d, 0xb8, 0x61, 0x3b, 0xc8, 0x7e, + 0xbc, 0x38, 0xba, 0x3b, 0xd2, 0x16, 0xcf, 0x04, 0x9a, 0x6e, 0xe0, 0x31, 0x7a, 0x8e, 0x28, 0x04, + 0x91, 0x95, 0x57, 0x6c, 0xa7, 0x1f, 0x80, 0x17, 0x19, 0xb2, 0x1e, 0x40, 0x97, 0x0e, 0x3d, 0xbd, + 0xe9, 0xd0, 0xb1, 0xe7, 0x9a, 0xea, 0x33, 0x3c, 0x75, 0xdf, 0xbd, 0xe0, 0x5d, 0x5b, 0x5e, 0xcd, + 0xa3, 0x40, 0x61, 0xe3, 0xaf, 0xef, 0x24, 0x62, 0xd1, 0xac, 0xfe, 0x23, 0x0d, 0xdb, 0xf1, 0xce, + 0x8d, 0x35, 0xc2, 0x06, 0xcf, 0xd2, 0x12, 0xbf, 0xc4, 0xaf, 0x7f, 0x69, 0x9f, 0x57, 0x6b, 0xb0, + 0xf4, 0x7d, 0x94, 0x13, 0xfd, 0x94, 0x2a, 0x34, 0x59, 0xe9, 0x64, 0xd7, 0x96, 0x8a, 0x2e, 0x3d, + 0xaf, 0x06, 0x23, 0xcc, 0x55, 0xb9, 0xc7, 0x1e, 0xb7, 0x9d, 0xe3, 0xb6, 0x6f, 0x7d, 0xb9, 0xed, + 0x47, 0x7d, 0x6e, 0xbc, 0xf0, 0xa8, 0xaf, 0x9d, 0x76, 0xd5, 0x4e, 0xbd, 0xad, 0x06, 0xea, 0xe4, + 0x1a, 0x64, 0x2c, 0xfd, 0xb3, 0x8b, 0x64, 0xa2, 0xe7, 0xa2, 0xcb, 0x06, 0x1e, 0x2d, 0xb0, 0xa7, + 0x8e, 0x64, 0x7a, 0xe5, 0xa2, 0xaf, 0xf1, 0x02, 0x1c, 0x42, 0x96, 0xc7, 0x8b, 0x00, 0x04, 0x11, + 0x93, 0xbf, 0x43, 0xf2, 0x90, 0x69, 0x74, 0x55, 0x76, 0x09, 0x90, 0xf5, 0x42, 0xaa, 0xf5, 0x5a, + 0x4a, 0x03, 0xef, 0x41, 0xf5, 0x5d, 0xc8, 0x89, 0x20, 0xb0, 0x0b, 0x12, 0x85, 0x01, 0x95, 0xc4, + 0x30, 0xb0, 0x21, 0x85, 0xb3, 0xc3, 0xce, 0xb1, 0xa2, 0xca, 0xa9, 0xf8, 0xf1, 0x7a, 0x78, 0xe7, + 0x62, 0x4d, 0xdb, 0x37, 0xc3, 0xa9, 0xbf, 0x48, 0x50, 0x8c, 0x35, 0x61, 0xac, 0xfc, 0xeb, 0x96, + 0xe5, 0x3c, 0xd3, 0x74, 0xcb, 0xd4, 0xbd, 0x80, 0x14, 0xc0, 0x45, 0x75, 0x26, 0xb9, 0xec, 0xa1, + 0x7d, 0x23, 0xce, 0xff, 0x41, 0x02, 0x79, 0xb9, 0x81, 0x5b, 0x72, 0x50, 0xfa, 0x56, 0x1d, 0xfc, + 0xbd, 0x04, 0xa5, 0x64, 0xd7, 0xb6, 0xe4, 0xde, 0xcd, 0x6f, 0xd5, 0xbd, 0xdf, 0x49, 0xb0, 0x93, + 0xe8, 0xd5, 0xfe, 0xaf, 0xbc, 0xfb, 0x6d, 0x1a, 0xf6, 0xd6, 0xe8, 0x61, 0xd6, 0x13, 0x4d, 0xad, + 0xe8, 0xb3, 0xbf, 0x77, 0x99, 0xb5, 0x6a, 0xac, 0x66, 0xf6, 0x74, 0xd7, 0x0f, 0x7a, 0x60, 0xac, + 0xb1, 0xe6, 0x08, 0x33, 0xb9, 0x39, 0x36, 0xb1, 0xe5, 0x13, 0x5f, 0x39, 0xa2, 0xd3, 0x2d, 0x2f, + 0xe4, 0xe2, 0x5b, 0xfc, 0xbb, 0x40, 0x66, 0x8e, 0x67, 0xfa, 0xe6, 0x53, 0xf6, 0x16, 0x18, 0x7e, + 0xb5, 0xb3, 0xce, 0x37, 0xa3, 0xca, 0xe1, 0x4c, 0xcb, 0xf6, 0x23, 0xb4, 0x4d, 0x27, 0xfa, 0x12, + 0x9a, 0xe5, 0xbe, 0xb4, 0x2a, 0x87, 0x33, 0x11, 0x1a, 0x9b, 0xd3, 0x91, 0x33, 0x67, 0x4d, 0x84, + 0xc0, 0xb1, 0x54, 0x2b, 0xa9, 0x45, 0x21, 0x8b, 0x20, 0x41, 0x97, 0xb7, 0x78, 0x2e, 0xd8, 0x56, + 0x8b, 0x42, 0x26, 0x20, 0x77, 0xa0, 0xac, 0x4f, 0x26, 0x2e, 0x33, 0x1e, 0x1a, 0x12, 0xad, 0x6b, + 0x29, 0x12, 0x73, 0xe0, 0xc1, 0x23, 0xc8, 0x87, 0x71, 0x60, 0xd5, 0x8c, 0x45, 0x02, 0x7b, 0x36, + 0xfe, 0x68, 0x93, 0x62, 0x2f, 0x08, 0x76, 0x38, 0x89, 0x8b, 0x9a, 0x9e, 0xb6, 0x78, 0x3d, 0x4c, + 0xe1, 0x7c, 0x5e, 0x2d, 0x9a, 0x5e, 0xf4, 0x5c, 0x54, 0xfd, 0x02, 0x6b, 0x7a, 0xf2, 0xf5, 0x93, + 0x34, 0x21, 0x6f, 0x39, 0xc8, 0x0f, 0xa6, 0x21, 0x9e, 0xde, 0xef, 0xbe, 0xe0, 0xc1, 0xb4, 0xd6, + 0x0e, 0xf0, 0x6a, 0xa4, 0x79, 0xf0, 0x37, 0x09, 0xf2, 0xa1, 0x18, 0xab, 0x53, 0x66, 0xa6, 0xfb, + 0xe7, 0xdc, 0x5c, 0xf6, 0x38, 0x25, 0x4b, 0x2a, 0x1f, 0x33, 0x39, 0x76, 0x40, 0x36, 0xa7, 0x40, + 0x20, 0x67, 0x63, 0x76, 0xae, 0x16, 0xd5, 0x47, 0xbc, 0x29, 0x76, 0xa6, 0x53, 0x3c, 0x49, 0x2f, + 0x3c, 0xd7, 0x40, 0xde, 0x08, 0xc4, 0xec, 0x11, 0xde, 0x77, 0x75, 0xd3, 0x4a, 0x60, 0x33, 0x1c, + 0x2b, 0x87, 0x13, 0x11, 0xf8, 0x08, 0xae, 0x85, 0x76, 0x47, 0xd4, 0xd7, 0xb1, 0xe1, 0x1e, 0x2d, + 0x94, 0x72, 0xfc, 0x69, 0xed, 0x6a, 0x00, 0x68, 0x06, 0xf3, 0xa1, 0x6e, 0xf5, 0xef, 0x12, 0xec, + 0x86, 0x6d, 0xfc, 0x28, 0x0a, 0x56, 0x07, 0x40, 0xb7, 0x6d, 0xc7, 0x8f, 0x87, 0x6b, 0x95, 0xca, + 0x2b, 0x7a, 0xb5, 0x7a, 0xa4, 0xa4, 0xc6, 0x0c, 0x1c, 0x4c, 0x01, 0x16, 0x33, 0x1b, 0xc3, 0x86, + 0xc9, 0x3d, 0x78, 0xda, 0xe6, 0xff, 0x3f, 0x22, 0xbe, 0xfd, 0x40, 0x88, 0x58, 0xbf, 0xcf, 0x9e, + 0xf1, 0xce, 0xe8, 0xc4, 0xb4, 0x83, 0x07, 0x37, 0x31, 0x08, 0x9f, 0xf1, 0x32, 0xd1, 0x33, 0xde, + 0xf1, 0xcf, 0xb0, 0xa1, 0x77, 0xa6, 0xcb, 0xee, 0x1e, 0xcb, 0x4b, 0xdf, 0x9f, 0xde, 0x47, 0xd2, + 0xa7, 0xb0, 0xe8, 0xce, 0xfe, 0x28, 0x49, 0x9f, 0xa7, 0xd2, 0x27, 0xbd, 0xe3, 0x3f, 0xa5, 0x0e, + 0x4e, 0x84, 0x6a, 0x2f, 0xdc, 0xa9, 0x4a, 0xc7, 0x16, 0x35, 0x98, 0xf7, 0xff, 0x0d, 0x00, 0x00, + 0xff, 0xff, 0x4c, 0x8f, 0xed, 0xda, 0x1b, 0x1a, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.proto b/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.proto new file mode 100644 index 0000000000..28410d4a9a --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/descriptor.proto @@ -0,0 +1,813 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + + +syntax = "proto2"; + +package google.protobuf; +option go_package = "descriptor"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option java_generate_equals_and_hash = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2" and "proto3". + optional string syntax = 12; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; + optional int32 end = 2; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + TYPE_GROUP = 10; // Tag-delimited aggregate. + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + }; + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REQUIRED = 2; + LABEL_REPEATED = 3; + // TODO(sanjay): Should we add LABEL_MAP? + }; + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + // TODO(kenton): Base-64 encode? + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default=false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default=false]; +} + + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + + // If set, all the classes from the .proto file are wrapped in a single + // outer class with the given name. This applies to both Proto1 + // (equivalent to the old "--one_java_file" option) and Proto2 (where + // a .proto always translates to a single class, but you may want to + // explicitly choose the class name). + optional string java_outer_classname = 8; + + // If set true, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the outer class + // named by java_outer_classname. However, the outer class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default=false]; + + // If set true, then the Java code generator will generate equals() and + // hashCode() methods for all messages defined in the .proto file. + // This increases generated code size, potentially substantially for large + // protos, which may harm a memory-constrained application. + // - In the full runtime this is a speed optimization, as the + // AbstractMessage base class includes reflection-based implementations of + // these methods. + // - In the lite runtime, setting this option changes the semantics of + // equals() and hashCode() to more closely match those of the full runtime; + // the generated methods compute their results based on field values rather + // than object identity. (Implementations should not assume that hashcodes + // will be consistent across runtimes or versions of the protocol compiler.) + optional bool java_generate_equals_and_hash = 20 [default=false]; + + // If set true, then the Java2 code generator will generate code that + // throws an exception whenever an attempt is made to assign a non-UTF-8 + // byte sequence to a string field. + // Message reflection will do the same. + // However, an extension field still accepts non-UTF-8 byte sequences. + // This option has no effect on when used with the lite runtime. + optional bool java_string_check_utf8 = 27 [default=false]; + + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default=SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default=false]; + optional bool java_generic_services = 17 [default=false]; + optional bool py_generic_services = 18 [default=false]; + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default=false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default=false]; + + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default=false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default=false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default=false]; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementions still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is not yet implemented in the open source + // release -- sorry, we'll try to include it in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. + optional bool packed = 2; + + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). By default these types are + // represented as JavaScript strings. This avoids loss of precision that can + // happen when a large value is converted to a floating point JavaScript + // numbers. Specifying JS_NUMBER for the jstype causes the generated + // JavaScript code to use the JavaScript "number" type instead of strings. + // This option is an enum to permit additional types to be added, + // e.g. goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // + // Note that implementations may choose not to check required fields within + // a lazy sub-message. That is, calling IsInitialized() on the outher message + // may return true even if the inner message has missing required fields. + // This is necessary because otherwise the inner message would have to be + // parsed in order to perform the check, defeating the purpose of lazy + // parsing. An implementation which chooses not to check required fields + // must be consistent about it. That is, for any particular sub-message, the + // implementation must either *always* check its required fields, or *never* + // check its required fields, regardless of whether or not the message has + // been parsed. + optional bool lazy = 5 [default=false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default=false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default=false]; + + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message OneofOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default=false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents + // "foo.(bar.baz).qux". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendent. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition. For + // example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed=true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed=true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to qux. + // // + // // Another line attached to qux. + // optional double qux = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to qux or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed=true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified offset. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + } +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.pb.go b/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.pb.go new file mode 100644 index 0000000000..5e9cff04d1 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.pb.go @@ -0,0 +1,248 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/protobuf/field_mask.proto +// DO NOT EDIT! + +package descriptor // import "google.golang.org/genproto/protobuf" + +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 + +// `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 +// field mask. +// +// 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 field +// mask. +// +// 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 fileDescriptor2, []int{0} } + +func init() { + proto.RegisterType((*FieldMask)(nil), "google.protobuf.FieldMask") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/protobuf/field_mask.proto", fileDescriptor2) +} + +var fileDescriptor2 = []byte{ + // 163 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x32, 0x49, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x07, 0x93, 0x49, 0xa5, 0x69, 0xfa, 0x69, 0x99, 0xa9, + 0x39, 0x29, 0xf1, 0xb9, 0x89, 0xc5, 0xd9, 0x7a, 0x60, 0x31, 0x21, 0x7e, 0xa8, 0x2e, 0x98, 0x0a, + 0x25, 0x45, 0x2e, 0x4e, 0x37, 0x90, 0x22, 0x5f, 0xa0, 0x1a, 0x21, 0x11, 0x2e, 0xd6, 0x82, 0xc4, + 0x92, 0x8c, 0x62, 0x09, 0x46, 0x05, 0x66, 0x0d, 0xce, 0x20, 0x08, 0xc7, 0x29, 0x90, 0x4b, 0x38, + 0x39, 0x3f, 0x57, 0x0f, 0x4d, 0xa7, 0x13, 0x1f, 0x5c, 0x5f, 0x00, 0x48, 0x28, 0x80, 0x71, 0x01, + 0x23, 0xe3, 0x22, 0x26, 0x66, 0xf7, 0x00, 0xa7, 0x55, 0x4c, 0x72, 0xee, 0x10, 0xc5, 0x01, 0x50, + 0xc5, 0x7a, 0xe1, 0xa9, 0x39, 0x39, 0xde, 0x79, 0xf9, 0xe5, 0x79, 0x21, 0x95, 0x05, 0xa9, 0xc5, + 0x49, 0x6c, 0x60, 0x53, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe8, 0x4c, 0x96, 0xee, 0xc5, + 0x00, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.proto b/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.proto new file mode 100644 index 0000000000..c51de09a83 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/field_mask.proto @@ -0,0 +1,246 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option java_generate_equals_and_hash = true; + +// `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 +// field mask. +// +// 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 field +// mask. +// +// 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. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.pb.go b/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.pb.go new file mode 100644 index 0000000000..991b7d711f --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.pb.go @@ -0,0 +1,50 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/protobuf/source_context.proto +// DO NOT EDIT! + +package descriptor // import "google.golang.org/genproto/protobuf" + +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 + +// `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 fileDescriptor3, []int{0} } + +func init() { + proto.RegisterType((*SourceContext)(nil), "google.protobuf.SourceContext") +} + +func init() { + proto.RegisterFile("google.golang.org/genproto/protobuf/source_context.proto", fileDescriptor3) +} + +var fileDescriptor3 = []byte{ + // 175 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x48, 0xcf, 0xcf, 0x4f, + 0xcf, 0x49, 0xd5, 0x4b, 0xcf, 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0xcb, 0x2f, 0x4a, 0xd7, 0x4f, 0x4f, + 0xcd, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0xd7, 0x07, 0x93, 0x49, 0xa5, 0x69, 0xfa, 0xc5, 0xf9, 0xa5, + 0x45, 0xc9, 0xa9, 0xf1, 0xc9, 0xf9, 0x79, 0x25, 0xa9, 0x15, 0x25, 0x7a, 0x60, 0x71, 0x21, 0x7e, + 0xa8, 0x4e, 0x98, 0x2a, 0x25, 0x1d, 0x2e, 0xde, 0x60, 0xb0, 0x42, 0x67, 0x88, 0x3a, 0x21, 0x69, + 0x2e, 0xce, 0xb4, 0xcc, 0x9c, 0xd4, 0xf8, 0xbc, 0xc4, 0xdc, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, + 0xce, 0x20, 0x0e, 0x90, 0x80, 0x1f, 0x90, 0xef, 0x14, 0xca, 0x25, 0x9c, 0x9c, 0x9f, 0xab, 0x87, + 0x66, 0x88, 0x93, 0x10, 0x8a, 0x11, 0x01, 0x20, 0xe1, 0x00, 0xc6, 0x05, 0x8c, 0x8c, 0x8b, 0x98, + 0x98, 0xdd, 0x03, 0x9c, 0x56, 0x31, 0xc9, 0xb9, 0x43, 0x34, 0x04, 0x40, 0x35, 0xe8, 0x85, 0xa7, + 0xe6, 0xe4, 0x78, 0xe7, 0xe5, 0x97, 0xe7, 0x85, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x4d, + 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x31, 0x36, 0x7e, 0xd8, 0x00, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.proto b/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.proto new file mode 100644 index 0000000000..a2c08e2b57 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/type.pb.go b/components/engine/vendor/google.golang.org/genproto/protobuf/type.pb.go new file mode 100644 index 0000000000..f9a4a09dae --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/type.pb.go @@ -0,0 +1,393 @@ +// Code generated by protoc-gen-go. +// source: google.golang.org/genproto/protobuf/type.proto +// DO NOT EDIT! + +package descriptor // import "google.golang.org/genproto/protobuf" + +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 + +// 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 fileDescriptor4, []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 fileDescriptor4, []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 fileDescriptor4, []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 *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 fileDescriptor4, []int{0} } + +func (m *Type) GetFields() []*Field { + if m != nil { + return m.Fields + } + return nil +} + +func (m *Type) GetOptions() []*Option { + if m != nil { + return m.Options + } + return nil +} + +func (m *Type) GetSourceContext() *SourceContext { + if m != nil { + return m.SourceContext + } + return nil +} + +// 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 fileDescriptor4, []int{1} } + +func (m *Field) GetOptions() []*Option { + if m != nil { + return m.Options + } + return nil +} + +// 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 *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 fileDescriptor4, []int{2} } + +func (m *Enum) GetEnumvalue() []*EnumValue { + if m != nil { + return m.Enumvalue + } + return nil +} + +func (m *Enum) GetOptions() []*Option { + if m != nil { + return m.Options + } + return nil +} + +func (m *Enum) GetSourceContext() *SourceContext { + if m != nil { + return m.SourceContext + } + return nil +} + +// 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 fileDescriptor4, []int{3} } + +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 example, `"java_package"`. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // The option's value. For example, `"com.google.protobuf"`. + 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 fileDescriptor4, []int{4} } + +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.golang.org/genproto/protobuf/type.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 800 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x55, 0xcd, 0x6e, 0xf2, 0x46, + 0x14, 0xad, 0xc1, 0x18, 0x7c, 0x1d, 0x88, 0xbf, 0x49, 0x94, 0xb8, 0x89, 0x94, 0x46, 0x74, 0x13, + 0x65, 0x61, 0x54, 0x52, 0x55, 0xd9, 0x42, 0x70, 0xa8, 0x15, 0x62, 0xbb, 0x83, 0x69, 0xc2, 0x0a, + 0x19, 0x30, 0x94, 0xc4, 0xb1, 0x11, 0x36, 0x6d, 0x78, 0x88, 0xbe, 0x43, 0xd5, 0x65, 0xd7, 0x7d, + 0x88, 0xbe, 0x55, 0x3b, 0x33, 0x06, 0x63, 0x7e, 0x2a, 0xa5, 0xfd, 0x16, 0x09, 0xbe, 0xe7, 0x9e, + 0x7b, 0xee, 0xcf, 0x5c, 0x8f, 0x41, 0x1d, 0x07, 0xc1, 0xd8, 0x73, 0xc9, 0x8f, 0xe7, 0xf8, 0x63, + 0x35, 0x98, 0x8d, 0x2b, 0x63, 0xd7, 0x9f, 0xce, 0x82, 0x28, 0xa8, 0xb0, 0xff, 0xfd, 0xf9, 0xa8, + 0x12, 0x2d, 0xa6, 0xae, 0xca, 0x2c, 0x74, 0xb8, 0xe4, 0xaf, 0x7c, 0x67, 0x95, 0xf1, 0x24, 0xfa, + 0x69, 0xde, 0x57, 0x07, 0xc1, 0x5b, 0x25, 0x16, 0x59, 0xc7, 0x4d, 0x69, 0x60, 0x58, 0x71, 0xfc, + 0x05, 0xfd, 0x8b, 0x63, 0xce, 0x6e, 0x3f, 0x92, 0x31, 0x0c, 0xe6, 0xb3, 0x81, 0xdb, 0x1b, 0x04, + 0x7e, 0xe4, 0xbe, 0x47, 0x71, 0x64, 0xf9, 0xd7, 0x0c, 0xf0, 0x36, 0x51, 0x44, 0x08, 0x78, 0xdf, + 0x79, 0x73, 0x15, 0xee, 0x92, 0xbb, 0x12, 0x31, 0x7b, 0x46, 0x2a, 0x08, 0xa3, 0x89, 0xeb, 0x0d, + 0x43, 0x25, 0x73, 0x99, 0xbd, 0x92, 0xaa, 0x27, 0xea, 0x56, 0xa5, 0xea, 0x3d, 0x75, 0xe3, 0x25, + 0x0b, 0x9d, 0x80, 0x10, 0xf8, 0x6e, 0x30, 0x0a, 0x95, 0x2c, 0xe1, 0x8b, 0x78, 0x69, 0xa1, 0x6f, + 0x20, 0x1f, 0x4c, 0xa3, 0x49, 0xe0, 0x87, 0x0a, 0xcf, 0x84, 0x4e, 0x77, 0x84, 0x4c, 0xe6, 0xc7, + 0x2b, 0x1e, 0xd2, 0xa0, 0xb4, 0x59, 0xaf, 0x92, 0x23, 0x85, 0x49, 0xd5, 0x8b, 0x9d, 0xc8, 0x36, + 0xa3, 0xdd, 0xc5, 0x2c, 0x5c, 0x0c, 0xd3, 0x26, 0xaa, 0x80, 0x10, 0x2e, 0xfc, 0xc8, 0x79, 0x57, + 0x04, 0x12, 0x5e, 0xda, 0x93, 0xb8, 0xcd, 0xdc, 0x78, 0x49, 0x2b, 0xff, 0x29, 0x40, 0x8e, 0x35, + 0x45, 0x42, 0xf9, 0xd7, 0x89, 0x3f, 0x64, 0x03, 0x29, 0x55, 0xcf, 0xf7, 0xb7, 0xae, 0x3e, 0x10, + 0x0a, 0x66, 0x44, 0xd4, 0x00, 0x69, 0xe0, 0xcc, 0x86, 0x13, 0xdf, 0xf1, 0x26, 0xd1, 0x82, 0x8c, + 0x8c, 0xc6, 0x95, 0xff, 0x25, 0xee, 0x6e, 0xcd, 0xc4, 0xe9, 0x30, 0x3a, 0x43, 0x7f, 0xfe, 0xd6, + 0x77, 0x67, 0x64, 0x86, 0xdc, 0x55, 0x0e, 0x2f, 0xad, 0xe4, 0x7c, 0xf8, 0xd4, 0xf9, 0x7c, 0x09, + 0x05, 0xba, 0x0d, 0xbd, 0xf9, 0xcc, 0x63, 0xfd, 0x89, 0x38, 0x4f, 0xed, 0xce, 0xcc, 0x43, 0x5f, + 0x81, 0xc4, 0x86, 0xdf, 0x23, 0x95, 0xb9, 0xef, 0x4a, 0x9e, 0x69, 0x01, 0x83, 0x74, 0x8a, 0xd0, + 0x3c, 0x53, 0x67, 0xf0, 0xea, 0x0e, 0x95, 0x02, 0xf1, 0x15, 0xf0, 0xd2, 0x4a, 0x9f, 0x95, 0xf8, + 0xc1, 0xb3, 0x3a, 0x07, 0xf1, 0x25, 0x0c, 0xfc, 0x1e, 0xab, 0x0f, 0x58, 0x1d, 0x05, 0x0a, 0x18, + 0xb4, 0xc6, 0xaf, 0xa1, 0x38, 0x74, 0x47, 0xce, 0xdc, 0x8b, 0x7a, 0x3f, 0x3b, 0xde, 0xdc, 0x55, + 0x24, 0x46, 0x38, 0x58, 0x82, 0x3f, 0x52, 0xac, 0xfc, 0x17, 0xd9, 0x42, 0x3a, 0x49, 0x24, 0xc3, + 0x81, 0xdd, 0xb5, 0xb4, 0x5e, 0xc7, 0x78, 0x30, 0xcc, 0x27, 0x43, 0xfe, 0x02, 0x1d, 0x82, 0xc4, + 0x90, 0x86, 0xd9, 0xa9, 0xb7, 0x34, 0x99, 0x43, 0x25, 0x00, 0x06, 0xdc, 0xb7, 0xcc, 0x9a, 0x2d, + 0x67, 0x12, 0x5b, 0x37, 0xec, 0xef, 0xbe, 0x95, 0xb3, 0x49, 0x40, 0x27, 0x06, 0xf8, 0x34, 0xe1, + 0xa6, 0x2a, 0xe7, 0x92, 0x1c, 0xf7, 0xfa, 0xb3, 0xd6, 0x20, 0x0c, 0x61, 0x13, 0x21, 0x9c, 0x3c, + 0x2a, 0x82, 0xc8, 0x90, 0xba, 0x69, 0xb6, 0xe4, 0x42, 0xa2, 0xd9, 0xb6, 0xb1, 0x6e, 0x34, 0x65, + 0x31, 0xd1, 0x6c, 0x62, 0xb3, 0x63, 0xc9, 0x90, 0x28, 0x3c, 0x6a, 0xed, 0x76, 0xad, 0xa9, 0xc9, + 0x52, 0xc2, 0xa8, 0x77, 0x6d, 0xad, 0x2d, 0x1f, 0x6c, 0x94, 0x45, 0x52, 0x14, 0x93, 0x14, 0x9a, + 0xd1, 0x79, 0x94, 0x4b, 0xe8, 0x13, 0x14, 0xe3, 0x14, 0xab, 0x22, 0x0e, 0xb7, 0x20, 0x52, 0xa9, + 0xbc, 0x2e, 0x24, 0x56, 0xf9, 0xb4, 0x01, 0x10, 0x06, 0x2a, 0x47, 0x20, 0xa5, 0x76, 0x0b, 0x9d, + 0xc2, 0xd1, 0x5d, 0x0d, 0x37, 0x74, 0xa3, 0xd6, 0xd2, 0xed, 0x6e, 0x6a, 0xae, 0x0a, 0x1c, 0xa7, + 0x1d, 0xa6, 0x65, 0xeb, 0x26, 0x79, 0x26, 0x03, 0xde, 0xf2, 0x60, 0xed, 0x87, 0x8e, 0x8e, 0xb5, + 0x06, 0x19, 0xf5, 0x8e, 0xc7, 0xd2, 0x6a, 0x36, 0xf1, 0x64, 0xcb, 0x7f, 0x73, 0xc0, 0x6b, 0x64, + 0x53, 0xf7, 0x5e, 0x23, 0xb7, 0x20, 0xba, 0xc4, 0x17, 0x1f, 0x7f, 0x7c, 0x93, 0x9c, 0xed, 0x2c, + 0x15, 0x8d, 0x66, 0xcb, 0x80, 0xd7, 0xe4, 0xf4, 0x32, 0x66, 0xff, 0xf7, 0xc5, 0xc1, 0x7f, 0xde, + 0xc5, 0x91, 0xfb, 0xd8, 0xc5, 0xf1, 0x02, 0x62, 0xd2, 0xc2, 0xde, 0x29, 0xac, 0x5f, 0xec, 0xcc, + 0xc6, 0x8b, 0xfd, 0xdf, 0x7b, 0x2c, 0x7f, 0x0f, 0x42, 0x0c, 0xed, 0x4d, 0x74, 0x0d, 0xb9, 0xd5, + 0xa8, 0x69, 0xe3, 0xc7, 0x3b, 0x72, 0x35, 0x7f, 0x81, 0x63, 0xca, 0x35, 0xb9, 0xe1, 0xe3, 0x3e, + 0xe8, 0xb2, 0xb5, 0xbb, 0x86, 0x5d, 0x7b, 0xee, 0x59, 0xd8, 0xb4, 0xcd, 0x2a, 0x59, 0x91, 0x2d, + 0xe8, 0x46, 0xe6, 0xea, 0x2d, 0x38, 0x22, 0x1f, 0xa5, 0x6d, 0xc5, 0xba, 0x48, 0x3f, 0x21, 0x16, + 0xb5, 0x2c, 0xee, 0x37, 0x8e, 0xfb, 0x3d, 0x93, 0x6d, 0x5a, 0xf5, 0x3f, 0x32, 0x17, 0xcd, 0x98, + 0x67, 0xad, 0x32, 0x3f, 0xb9, 0x9e, 0xf7, 0xe0, 0x07, 0xbf, 0xf8, 0x94, 0x1f, 0xf6, 0x05, 0x26, + 0x70, 0xf3, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x55, 0x19, 0x59, 0x69, 0x31, 0x07, 0x00, 0x00, +} diff --git a/components/engine/vendor/google.golang.org/genproto/protobuf/type.proto b/components/engine/vendor/google.golang.org/genproto/protobuf/type.proto new file mode 100644 index 0000000000..7d943129d7 --- /dev/null +++ b/components/engine/vendor/google.golang.org/genproto/protobuf/type.proto @@ -0,0 +1,180 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// 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. + +syntax = "proto3"; + +package google.protobuf; + +import "github.com/golang/protobuf/ptypes/any/any.proto"; // from google/protobuf/any.proto +import "google.golang.org/genproto/protobuf/source_context.proto"; // from google/protobuf/source_context.proto + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option java_generate_equals_and_hash = true; +option objc_class_prefix = "GPB"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + }; + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + }; + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // 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. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For example, `"java_package"`. + string name = 1; + // The option's value. For example, `"com.google.protobuf"`. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; +}