gddo: remove no longer used internal support packages. Change-Id: I29ef5640e1196a9804e1a2fd6de06541d1fb0049 Reviewed-on: https://go-review.googlesource.com/87895 Reviewed-by: Ross Light <light@google.com>
diff --git a/internal/requestlog/fluentd.go b/internal/requestlog/fluentd.go deleted file mode 100644 index 26a3ef0..0000000 --- a/internal/requestlog/fluentd.go +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2017 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 or at -// https://developers.google.com/open-source/licenses/bsd. - -package requestlog - -import ( - "bytes" - "encoding/json" - "io" - "strconv" - "sync" - "time" -) - -// A FluentdLogger writes log entries in the Fluentd forward JSON -// format. The record's fields are suitable for consumption by -// Stackdriver Logging. -type FluentdLogger struct { - tag string - onErr func(error) - - mu sync.Mutex - w io.Writer - buf bytes.Buffer - enc *json.Encoder -} - -// NewFluentdLogger returns a new logger that writes to w. -func NewFluentdLogger(w io.Writer, tag string, onErr func(error)) *FluentdLogger { - l := &FluentdLogger{ - tag: tag, - w: w, - onErr: onErr, - } - l.enc = json.NewEncoder(&l.buf) - return l -} - -// Log writes a record to its writer. Multiple concurrent calls will -// produce sequential writes to its writer. -func (l *FluentdLogger) Log(ent *Entry) { - if err := l.log(ent); err != nil { - l.onErr(err) - } -} - -func (l *FluentdLogger) log(ent *Entry) error { - defer l.mu.Unlock() - l.mu.Lock() - - l.buf.Reset() - l.buf.WriteByte('[') - if err := l.enc.Encode(l.tag); err != nil { - return err - } - l.buf.WriteByte(',') - t := ent.ReceivedTime.Add(ent.Latency) - if err := l.enc.Encode(t.Unix()); err != nil { - return err - } - l.buf.WriteByte(',') - - var r struct { - HTTPRequest struct { - RequestMethod string `json:"requestMethod"` - RequestURL string `json:"requestUrl"` - RequestSize int64 `json:"requestSize,string"` - Status int `json:"status"` - ResponseSize int64 `json:"responseSize,string"` - UserAgent string `json:"userAgent"` - RemoteIP string `json:"remoteIp"` - Referer string `json:"referer"` - Latency string `json:"latency"` - } `json:"httpRequest"` - Timestamp struct { - Seconds int64 `json:"seconds"` - Nanos int `json:"nanos"` - } `json:"timestamp"` - } - r.HTTPRequest.RequestMethod = ent.RequestMethod - r.HTTPRequest.RequestURL = ent.RequestURL - // TODO(light): determine whether this is the formula LogEntry expects. - r.HTTPRequest.RequestSize = ent.RequestHeaderSize + ent.RequestBodySize - r.HTTPRequest.Status = ent.Status - // TODO(light): determine whether this is the formula LogEntry expects. - r.HTTPRequest.ResponseSize = ent.ResponseHeaderSize + ent.ResponseBodySize - r.HTTPRequest.UserAgent = ent.UserAgent - r.HTTPRequest.RemoteIP = ent.RemoteIP - r.HTTPRequest.Referer = ent.Referer - r.HTTPRequest.Latency = string(appendLatency(nil, ent.Latency)) - r.Timestamp.Seconds = t.Unix() - r.Timestamp.Nanos = t.Nanosecond() - if err := l.enc.Encode(r); err != nil { - return err - } - l.buf.WriteByte(']') - _, err := l.w.Write(l.buf.Bytes()) - return err -} - -func appendLatency(b []byte, d time.Duration) []byte { - // Parses format understood by google-fluentd (which is looser than the documented LogEntry format). - // See the comment at https://github.com/GoogleCloudPlatform/fluent-plugin-google-cloud/blob/e2f60cdd1d97e79ffe4e91bdbf6bd84837f27fa5/lib/fluent/plugin/out_google_cloud.rb#L1539 - b = strconv.AppendFloat(b, d.Seconds(), 'f', 9, 64) - b = append(b, 's') - return b -}
diff --git a/internal/requestlog/fluentd_test.go b/internal/requestlog/fluentd_test.go deleted file mode 100644 index 8d696b8..0000000 --- a/internal/requestlog/fluentd_test.go +++ /dev/null
@@ -1,219 +0,0 @@ -// Copyright 2017 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 or at -// https://developers.google.com/open-source/licenses/bsd. - -package requestlog - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/http/httptest" - "strings" - "testing" - "time" -) - -func TestFluentdLog(t *testing.T) { - const ( - startTime = 1507914000 - startTimeNanos = 512 - - latencySec = 5 - latencyNanos = 123456789 - - endTime = startTime + latencySec - endTimeNanos = startTimeNanos + latencyNanos - ) - buf := new(bytes.Buffer) - var logErr error - l := NewFluentdLogger(buf, "mytag", func(e error) { logErr = e }) - want := &Entry{ - ReceivedTime: time.Unix(startTime, startTimeNanos), - RequestMethod: "POST", - RequestURL: "/foo/bar", - RequestHeaderSize: 456, - RequestBodySize: 123000, - UserAgent: "Chrome proxied through Firefox and Edge", - Referer: "http://www.example.com/", - Proto: "HTTP/1.1", - RemoteIP: "12.34.56.78", - ServerIP: "127.0.0.1", - Status: 404, - ResponseHeaderSize: 555, - ResponseBodySize: 789000, - Latency: latencySec*time.Second + latencyNanos*time.Nanosecond, - } - ent := *want // copy in case Log accidentally mutates - l.Log(&ent) - if logErr != nil { - t.Error("Logger called error callback:", logErr) - } - - var got []json.RawMessage - if err := json.Unmarshal(buf.Bytes(), &got); err != nil { - t.Fatal("Unmarshal:", err) - } - - if len(got) == 0 { - t.Fatal("Message is empty; want 3 elements") - } - var tag string - if err := json.Unmarshal(got[0], &tag); err != nil { - t.Error("Unmarshal tag:", err) - } else if want := "mytag"; tag != want { - t.Errorf("tag = %q; want %q", tag, want) - } - - if len(got) < 2 { - t.Fatal("Message only has 1 element; want 3 elements") - } - var timestamp int64 - if err := json.Unmarshal(got[1], ×tamp); err != nil { - t.Error("Unmarshal timestamp:", err) - } else if want := int64(endTime); timestamp != want { - t.Errorf("timestamp = %d; want %d", timestamp, want) - } - - if len(got) < 3 { - t.Fatal("Message only has 2 elements; want 3 elements") - } - var r map[string]interface{} - if err := json.Unmarshal(got[2], &r); err != nil { - t.Error("Unmarshal record:", err) - } else { - rr, _ := r["httpRequest"].(map[string]interface{}) - if rr == nil { - t.Error("httpRequest does not exist in record or is not a JSON object") - } - if got, want := jsonString(rr, "requestMethod"), ent.RequestMethod; got != want { - t.Errorf("httpRequest.requestMethod = %q; want %q", got, want) - } - if got, want := jsonString(rr, "requestUrl"), ent.RequestURL; got != want { - t.Errorf("httpRequest.requestUrl = %q; want %q", got, want) - } - if got, want := jsonString(rr, "requestSize"), "123456"; got != want { - t.Errorf("httpRequest.requestSize = %q; want %q", got, want) - } - if got, want := jsonNumber(rr, "status"), float64(ent.Status); got != want { - t.Errorf("httpRequest.status = %d; want %d", int64(got), int64(want)) - } - if got, want := jsonString(rr, "responseSize"), "789555"; got != want { - t.Errorf("httpRequest.responseSize = %q; want %q", got, want) - } - if got, want := jsonString(rr, "userAgent"), ent.UserAgent; got != want { - t.Errorf("httpRequest.userAgent = %q; want %q", got, want) - } - if got, want := jsonString(rr, "remoteIp"), ent.RemoteIP; got != want { - t.Errorf("httpRequest.remoteIp = %q; want %q", got, want) - } - if got, want := jsonString(rr, "referer"), ent.Referer; got != want { - t.Errorf("httpRequest.referer = %q; want %q", got, want) - } - if got, want := jsonString(rr, "latency"), "5.123456789"; parseLatency(got) != want { - t.Errorf("httpRequest.latency = %q; want %q", got, want+"s") - } - ts, _ := r["timestamp"].(map[string]interface{}) - if ts == nil { - t.Error("timestamp does not exist in record or is not a JSON object") - } - if got, want := jsonNumber(ts, "seconds"), float64(endTime); got != want { - t.Errorf("timestamp.seconds = %g; want %g", got, want) - } - if got, want := jsonNumber(ts, "nanos"), float64(endTimeNanos); got != want { - t.Errorf("timestamp.nanos = %g; want %g", got, want) - } - } - if len(got) > 3 { - t.Errorf("Message has %d elements; want 3 elements", len(got)) - } -} - -func parseLatency(s string) string { - s = strings.TrimSpace(s) - if !strings.HasSuffix(s, "s") { - return "" - } - s = strings.TrimSpace(s[:len(s)-1]) - for _, c := range s { - if !(c >= '0' && c <= '9') && c != '.' { - return "" - } - } - return s -} - -func jsonString(obj map[string]interface{}, k string) string { - v, _ := obj[k].(string) - return v -} - -func jsonNumber(obj map[string]interface{}, k string) float64 { - v, _ := obj[k].(float64) - return v -} - -func BenchmarkFluentdLog(b *testing.B) { - ent := &Entry{ - ReceivedTime: time.Date(2017, time.October, 13, 17, 0, 0, 512, time.UTC), - RequestMethod: "POST", - RequestURL: "/foo/bar", - RequestHeaderSize: 456, - RequestBodySize: 123000, - UserAgent: "Chrome proxied through Firefox and Edge", - Referer: "http://www.example.com/", - Proto: "HTTP/1.1", - RemoteIP: "12.34.56.78", - ServerIP: "127.0.0.1", - Status: 404, - ResponseHeaderSize: 555, - ResponseBodySize: 789000, - Latency: 5 * time.Second, - } - var buf bytes.Buffer - l := NewFluentdLogger(&buf, "mytag", func(error) {}) - l.Log(ent) - b.ReportAllocs() - b.SetBytes(int64(buf.Len())) - buf.Reset() - b.ResetTimer() - - l = NewFluentdLogger(ioutil.Discard, "mytag", func(error) {}) - for i := 0; i < b.N; i++ { - l.Log(ent) - } -} - -func BenchmarkE2E(b *testing.B) { - run := func(b *testing.B, handler http.Handler) { - s := httptest.NewServer(handler) - defer s.Close() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - resp, err := http.Get(s.URL) - if err != nil { - b.Fatal(err) - } - io.Copy(ioutil.Discard, resp.Body) - resp.Body.Close() - } - } - b.Run("Baseline", func(b *testing.B) { - run(b, http.HandlerFunc(benchHandler)) - }) - b.Run("WithLog", func(b *testing.B) { - l := NewFluentdLogger(ioutil.Discard, "mytag", func(error) {}) - run(b, NewHandler(l, http.HandlerFunc(benchHandler))) - }) -} - -func benchHandler(w http.ResponseWriter, r *http.Request) { - const msg = "Hello, World!" - w.Header().Set("Content-Length", fmt.Sprint(len(msg))) - io.WriteString(w, msg) -}
diff --git a/internal/requestlog/requestlog.go b/internal/requestlog/requestlog.go deleted file mode 100644 index c528de5..0000000 --- a/internal/requestlog/requestlog.go +++ /dev/null
@@ -1,185 +0,0 @@ -// Copyright 2017 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 or at -// https://developers.google.com/open-source/licenses/bsd. - -// Package requestlog provides an http.Handler that logs information -// about requests. -package requestlog - -import ( - "errors" - "io" - "io/ioutil" - "net" - "net/http" - "time" -) - -// Logger wraps the Log method. Log must be safe to call from multiple -// goroutines. Log must not hold onto an Entry after it returns. -type Logger interface { - Log(*Entry) -} - -// A Handler emits request information to a Logger. -type Handler struct { - log Logger - h http.Handler -} - -// NewHandler returns a handler that emits information to log and calls -// h.ServeHTTP. -func NewHandler(log Logger, h http.Handler) *Handler { - return &Handler{ - log: log, - h: h, - } -} - -// ServeHTTP calls its underlying handler's ServeHTTP method, then calls -// Log after the handler returns. -// -// ServeHTTP will always consume the request body up to the first error, -// even if the underlying handler does not. -func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - start := time.Now() - ent := &Entry{ - ReceivedTime: start, - RequestMethod: r.Method, - RequestURL: r.URL.String(), - RequestHeaderSize: headerSize(r.Header), - UserAgent: r.UserAgent(), - Referer: r.Referer(), - Proto: r.Proto, - RemoteIP: ipFromHostPort(r.RemoteAddr), - } - if addr, ok := r.Context().Value(http.LocalAddrContextKey).(net.Addr); ok { - ent.ServerIP = ipFromHostPort(addr.String()) - } - r2 := new(http.Request) - *r2 = *r - rcc := &readCounterCloser{r: r.Body} - r2.Body = rcc - w2 := &responseStats{w: w} - - h.h.ServeHTTP(w2, r2) - - ent.Latency = time.Since(start) - if rcc.err == nil { - // If the handler hasn't encountered an error in the Body (like EOF), - // then consume the rest of the Body to provide an accurate rcc.n. - io.Copy(ioutil.Discard, rcc) - } - ent.RequestBodySize = rcc.n - ent.Status = w2.code - if ent.Status == 0 { - ent.Status = http.StatusOK - } - ent.ResponseHeaderSize, ent.ResponseBodySize = w2.size() - h.log.Log(ent) -} - -// Entry records information about a completed HTTP request. -type Entry struct { - ReceivedTime time.Time - RequestMethod string - RequestURL string - RequestHeaderSize int64 - RequestBodySize int64 - UserAgent string - Referer string - Proto string - - RemoteIP string - ServerIP string - - Status int - ResponseHeaderSize int64 - ResponseBodySize int64 - Latency time.Duration -} - -func ipFromHostPort(hp string) string { - h, _, err := net.SplitHostPort(hp) - if err != nil { - return "" - } - if len(h) > 0 && h[0] == '[' { - return h[1 : len(h)-1] - } - return h -} - -type readCounterCloser struct { - r io.ReadCloser - n int64 - err error -} - -func (rcc *readCounterCloser) Read(p []byte) (n int, err error) { - if rcc.err != nil { - return 0, rcc.err - } - n, rcc.err = rcc.r.Read(p) - rcc.n += int64(n) - return n, rcc.err -} - -func (rcc *readCounterCloser) Close() error { - rcc.err = errors.New("read from closed reader") - return rcc.r.Close() -} - -type writeCounter int64 - -func (wc *writeCounter) Write(p []byte) (n int, err error) { - *wc += writeCounter(len(p)) - return len(p), nil -} - -func headerSize(h http.Header) int64 { - var wc writeCounter - h.Write(&wc) - return int64(wc) + 2 // for CRLF -} - -type responseStats struct { - w http.ResponseWriter - hsize int64 - wc writeCounter - code int -} - -func (r *responseStats) Header() http.Header { - return r.w.Header() -} - -func (r *responseStats) WriteHeader(statusCode int) { - if r.code != 0 { - return - } - r.hsize = headerSize(r.w.Header()) - r.w.WriteHeader(statusCode) - r.code = statusCode -} - -func (r *responseStats) Write(p []byte) (n int, err error) { - if r.code == 0 { - r.WriteHeader(http.StatusOK) - } - n, err = r.w.Write(p) - r.wc.Write(p[:n]) - return -} - -func (r *responseStats) size() (hdr, body int64) { - if r.code == 0 { - return headerSize(r.w.Header()), 0 - } - // Use the header size from the time WriteHeader was called. - // The Header map can be mutated after the call to add HTTP Trailers, - // which we don't want to count. - return r.hsize, int64(r.wc) -}
diff --git a/internal/requestlog/requestlog_test.go b/internal/requestlog/requestlog_test.go deleted file mode 100644 index 7b00e30..0000000 --- a/internal/requestlog/requestlog_test.go +++ /dev/null
@@ -1,92 +0,0 @@ -// Copyright 2017 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 or at -// https://developers.google.com/open-source/licenses/bsd. - -package requestlog - -import ( - "fmt" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" -) - -func TestHandler(t *testing.T) { - const requestMsg = "Hello, World!" - const responseMsg = "I see you." - const userAgent = "Request Log Test UA" - const referer = "http://www.example.com/" - - r, err := http.NewRequest("POST", "http://localhost/foo", strings.NewReader(requestMsg)) - if err != nil { - t.Fatal("NewRequest:", err) - } - r.Header.Set("User-Agent", userAgent) - r.Header.Set("Referer", referer) - requestHdrSize := len(fmt.Sprintf("User-Agent: %s\r\nReferer: %s\r\nContent-Length: %v\r\n", userAgent, referer, len(requestMsg))) - responseHdrSize := len(fmt.Sprintf("Content-Length: %v\r\n", len(responseMsg))) - ent, err := roundTrip(r, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Length", fmt.Sprint(len(responseMsg))) - w.WriteHeader(http.StatusOK) - io.WriteString(w, responseMsg) - })) - if err != nil { - t.Fatal("Could not get entry:", err) - } - if want := "POST"; ent.RequestMethod != want { - t.Errorf("RequestMethod = %q; want %q", ent.RequestMethod, want) - } - if want := "/foo"; ent.RequestURL != want { - t.Errorf("RequestURL = %q; want %q", ent.RequestURL, want) - } - if ent.RequestHeaderSize < int64(requestHdrSize) { - t.Errorf("RequestHeaderSize = %d; want >=%d", ent.RequestHeaderSize, requestHdrSize) - } - if ent.RequestBodySize != int64(len(requestMsg)) { - t.Errorf("RequestBodySize = %d; want %d", ent.RequestBodySize, len(requestMsg)) - } - if ent.UserAgent != userAgent { - t.Errorf("UserAgent = %q; want %q", ent.UserAgent, userAgent) - } - if ent.Referer != referer { - t.Errorf("Referer = %q; want %q", ent.Referer, referer) - } - if want := "HTTP/1.1"; ent.Proto != want { - t.Errorf("Proto = %q; want %q", ent.Proto, want) - } - if ent.Status != http.StatusOK { - t.Errorf("Status = %d; want %d", ent.Status, http.StatusOK) - } - if ent.ResponseHeaderSize < int64(responseHdrSize) { - t.Errorf("ResponseHeaderSize = %d; want >=%d", ent.ResponseHeaderSize, responseHdrSize) - } - if ent.ResponseBodySize != int64(len(responseMsg)) { - t.Errorf("ResponseBodySize = %d; want %d", ent.ResponseBodySize, len(responseMsg)) - } -} - -func roundTrip(r *http.Request, h http.Handler) (*Entry, error) { - capture := new(captureLogger) - hh := NewHandler(capture, h) - s := httptest.NewServer(hh) - defer s.Close() - r.URL.Host = s.URL[len("http://"):] - resp, err := http.DefaultClient.Do(r) - if err != nil { - return nil, err - } - resp.Body.Close() - return &capture.ent, nil -} - -type captureLogger struct { - ent Entry -} - -func (cl *captureLogger) Log(ent *Entry) { - cl.ent = *ent -}
diff --git a/internal/runtimeconfig/_demo/demo.go b/internal/runtimeconfig/_demo/demo.go deleted file mode 100644 index 82f29ad..0000000 --- a/internal/runtimeconfig/_demo/demo.go +++ /dev/null
@@ -1,90 +0,0 @@ -/* -This binary demonstrates watching over a Runtime Configurator variable using the runtimeconfig -package. To cancel the Watcher.Watch call, enter 'x' and '<enter>' keys on the terminal. -*/ -package main - -import ( - "context" - "fmt" - "log" - "os" - "path" - "time" - - "github.com/golang/gddo/internal/runtimeconfig" -) - -func main() { - if len(os.Args) != 4 { - fmt.Fprintf(os.Stderr, - "Usage: %s <project-id> <config-name> <var-name>\n\n", - path.Base(os.Args[0])) - os.Exit(1) - } - - projectID := os.Args[1] - configName := os.Args[2] - varName := os.Args[3] - - ctx := context.Background() - client, err := runtimeconfig.NewClient(ctx) - if err != nil { - log.Fatal(err) - } - defer client.Close() - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - w, err := client.NewWatcher(ctx, projectID, configName, varName, - &runtimeconfig.WatchOptions{WaitTime: 10 * time.Second}) - if err != nil { - log.Fatal(err) - } - - go func() { - key := make([]byte, 1) - for { - n, err := os.Stdin.Read(key) - if err != nil { - log.Printf("stdin error: %v\n", err) - } - if n == 1 && key[0] == 'x' { - log.Println("quiting demo") - cancel() - time.Sleep(1 * time.Second) - os.Exit(0) - } - } - }() - - vrbl := w.Variable() - log.Printf("watching variable %v\n", variableString(&vrbl)) - - isWatching := true - for isWatching { - log.Println("waiting for update...") - select { - case <-ctx.Done(): - log.Println("done watching") - isWatching = false - default: - err := w.Watch(ctx) - vrbl = w.Variable() - if err == nil { - log.Printf("Updated: %s\n", variableString(&vrbl)) - } else { - log.Println(err) - if runtimeconfig.IsDeleted(err) { - log.Printf("Deleted: %s\n", variableString(&vrbl)) - } - } - } - } -} - -func variableString(v *runtimeconfig.Variable) string { - return fmt.Sprintf("<name: %q, value: %q, isDeleted: %t, updateTime: %v>", - v.Name, string(v.Value), v.IsDeleted, v.UpdateTime) -}
diff --git a/internal/runtimeconfig/example_test.go b/internal/runtimeconfig/example_test.go deleted file mode 100644 index dcf0517..0000000 --- a/internal/runtimeconfig/example_test.go +++ /dev/null
@@ -1,45 +0,0 @@ -package runtimeconfig_test - -import ( - "context" - "log" - - "github.com/golang/gddo/internal/runtimeconfig" -) - -func Example() { - // Create a Client object. - ctx := context.Background() - client, err := runtimeconfig.NewClient(ctx) - if err != nil { - log.Fatal(err) - } - defer client.Close() - - // Create a Watcher object. - w, err := client.NewWatcher(ctx, "project", "config-name", "food", nil) - // Use retrieved Variable and apply to configurations accordingly. - log.Printf("value: %s\n", string(w.Variable().Value)) - - // Optionally, get a Context with cancel func to stop the Watch call. - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - // Have a separate goroutine that waits for changes. - go func() { - for { - select { - case <-ctx.Done(): - // Cancelled or timed out. - return - default: - if err := w.Watch(ctx); err != nil { - // Log or handle other errors - continue - } - // Use updated variable accordingly. - log.Printf("value: %s\n", string(w.Variable().Value)) - } - } - }() -}
diff --git a/internal/runtimeconfig/runtimeconfig.go b/internal/runtimeconfig/runtimeconfig.go deleted file mode 100644 index 9cc8c61..0000000 --- a/internal/runtimeconfig/runtimeconfig.go +++ /dev/null
@@ -1,238 +0,0 @@ -// Package runtimeconfig provides a limited set of client-side APIs for the Cloud Runtime -// Configurator. The Cloud Runtime Configurator service allows projects to store runtime -// configurations in the cloud and have clients fetch and get notified of changes to configuration -// values during runtime. -// -// This package provides a Client that sets up a Watcher for detecting updates on a Runtime -// Configurator variable. -package runtimeconfig - -import ( - "context" - "errors" - "fmt" - "sync" - "time" - - "github.com/golang/protobuf/ptypes" - "google.golang.org/api/option" - transport "google.golang.org/api/transport/grpc" - pb "google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -const ( - // endpoint is the address of the GCP Runtime Configurator API. - endPoint = "runtimeconfig.googleapis.com:443" - // defaultWaitTimeout is the default value for WatchOptions.WaitTime if not set. - defaultWaitTimeout = 10 * time.Minute -) - -// List of authentication scopes required for using the Runtime Configurator API. -var authScopes = []string{ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloudruntimeconfig", -} - -// Client is a RuntimeConfigManager client. It wraps the gRPC client stub and currently exposes -// only a few APIs primarily for fetching and watching over configuration variables. -type Client struct { - conn *grpc.ClientConn - // The gRPC API client. - client pb.RuntimeConfigManagerClient -} - -// NewClient constructs a Client instance from given gRPC connection. -func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { - opts = append(opts, option.WithEndpoint(endPoint), option.WithScopes(authScopes...)) - conn, err := transport.Dial(ctx, opts...) - if err != nil { - return nil, err - } - return &Client{ - conn: conn, - client: pb.NewRuntimeConfigManagerClient(conn), - }, nil -} - -// Close tears down the gRPC connection used by this Client. -func (c *Client) Close() error { - return c.conn.Close() -} - -// NewWatcher will fetch variable for given projectID, configName and varName, then constructs a -// Watcher object containing the fetched variable. Users can then use the Watcher to retrieve the -// variable as well as wait for changes. -func (c *Client) NewWatcher(ctx context.Context, projectID, configName, varName string, - opts *WatchOptions) (*Watcher, error) { - - name := fmt.Sprintf("projects/%s/configs/%s/variables/%s", projectID, configName, varName) - vpb, err := c.client.GetVariable(ctx, &pb.GetVariableRequest{Name: name}) - if err != nil { - return nil, err - } - - if opts == nil { - opts = &WatchOptions{} - } - waitTime := opts.WaitTime - switch { - case waitTime == 0: - waitTime = defaultWaitTimeout - case waitTime < 0: - return nil, fmt.Errorf("cannot have negative WaitTime option value: %v", waitTime) - } - - // Make sure update time is valid before copying. - updateTime, err := parseUpdateTime(vpb) - if err != nil { - return nil, err - } - - w := &Watcher{ - client: c.client, - waitTime: waitTime, - lastRPCTime: time.Now(), - } - copyFromProto(vpb, &w.vrbl, updateTime) - return w, nil -} - -// WatchOptions provide optional configurations to the Watcher. -type WatchOptions struct { - // WaitTime controls the frequency of making RPC and checking for updates by the Watch method. - // A Watcher keeps track of the last time it made an RPC, when Watch is called, it waits for - // configured WaitTime from the last RPC before making another RPC. The smaller the value, the - // higher the frequency of making RPCs, which also means faster rate of hitting the API quota. - // - // If this option is not set or set to 0, it uses defaultWaitTimeout value. - WaitTime time.Duration -} - -// Watcher caches a variable in memory and listens for updates from the Runtime Configurator -// service. -type Watcher struct { - client pb.RuntimeConfigManagerClient - waitTime time.Duration - lastRPCTime time.Time - - mu sync.Mutex - vrbl Variable -} - -// Variable returns a shallow copy of the associated variable of this Watcher object. It is safe to -// use from multiple goroutines. -func (w *Watcher) Variable() Variable { - w.mu.Lock() - defer w.mu.Unlock() - return w.vrbl -} - -var errDeleted = errors.New("deleted variable") - -// IsDeleted returns true if variable has been deleted. -func IsDeleted(err error) bool { - return err == errDeleted -} - -// Watch blocks until the variable changes, the Context's Done channel closes, or an RPC -// error occurs. -// -// If the variable has a new value, then method returns nil and the value can be retrieved by -// calling Variable. -// -// If the variable is deleted, then method returns an error that will be matched by IsDeleted. -// Subsequent calls to this method will block until the variable is restored or another error -// occurs. -// -// It is NOT safe to call this method from multiple goroutines. -// -// To stop this function from blocking, caller can passed in Context object constructed via -// WithCancel and call the cancel function. -func (w *Watcher) Watch(ctx context.Context) error { - // Loop to check for changes or continue waiting. - for { - // Block until waitTime or context cancelled/timed out. - waitTime := w.waitTime - time.Now().Sub(w.lastRPCTime) - select { - case <-time.After(waitTime): - case <-ctx.Done(): - return ctx.Err() - } - - // Use GetVariables RPC and check for deltas based on the response. May consider using - // ListVariables RPC with Filter=<key> and ReturnValues=false to identify deltas before - // doing a GetVariable to potentially save on response size. However, even with - // Filter=<key>, the response on ListVariables may return more than one matching variable - // and this code will need to iterate through calling more ListVariables RPCs. - vpb, err := w.client.GetVariable(ctx, &pb.GetVariableRequest{Name: w.vrbl.Name}) - w.lastRPCTime = time.Now() - if err == nil { - updateTime, err := parseUpdateTime(vpb) - if err != nil { - return err - } - - // Determine if there are any changes based on update_time field. If there are, update - // cache and return nil, else continue on. - // TODO(herbie): It is currently possible to have update_time changed but without any - // changes in the content. Need to re-evaluate if this should instead check for actual - // content changes. - w.mu.Lock() - if !w.vrbl.UpdateTime.Equal(updateTime) { - copyFromProto(vpb, &w.vrbl, updateTime) - w.mu.Unlock() - return nil - } - w.mu.Unlock() - - } else { - if st, ok := status.FromError(err); !ok || st.Code() != codes.NotFound { - return err - } - // For RPC not found error, if last known state is not deleted, update and return - // errDeleted, else treat as no change has occurred. - w.mu.Lock() - if !w.vrbl.IsDeleted { - w.vrbl.IsDeleted = true - w.vrbl.UpdateTime = time.Now().UTC() - w.mu.Unlock() - return errDeleted - } - w.mu.Unlock() - } - } -} - -// Variable contains the runtime configuration data. -// Treat Value field as read-only. Writes to it may affect other Variable objects containing -// reference to the same backing array. -type Variable struct { - Name string - Value []byte - IsDeleted bool - UpdateTime time.Time -} - -func copyFromProto(vpb *pb.Variable, vrbl *Variable, updateTime time.Time) { - vrbl.Name = vpb.Name - vrbl.UpdateTime = updateTime - vrbl.IsDeleted = false - vrbl.Value = vpb.GetValue() - // We currently only expose content in []byte. If proto contains text content, convert that to - // []byte. - if _, isText := vpb.GetContents().(*pb.Variable_Text); isText { - vrbl.Value = []byte(vpb.GetText()) - } -} - -func parseUpdateTime(vpb *pb.Variable) (time.Time, error) { - updateTime, err := ptypes.Timestamp(vpb.GetUpdateTime()) - if err != nil { - return time.Time{}, fmt.Errorf( - "variable message for name=%q contains invalid timestamp: %v", vpb.Name, err) - } - return updateTime, nil -}
diff --git a/internal/runtimeconfig/runtimeconfig_test.go b/internal/runtimeconfig/runtimeconfig_test.go deleted file mode 100644 index c82dea6..0000000 --- a/internal/runtimeconfig/runtimeconfig_test.go +++ /dev/null
@@ -1,266 +0,0 @@ -package runtimeconfig - -import ( - "context" - "fmt" - "net" - "strings" - "testing" - "time" - - tspb "github.com/golang/protobuf/ptypes/timestamp" - "github.com/google/go-cmp/cmp" - pb "google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -// Set wait timeout used for tests. -var watchOpt = &WatchOptions{ - WaitTime: 500 * time.Millisecond, -} - -// fakeServer partially implements RuntimeConfigManagerServer for Client to connect to. Prefill -// responses field with the ordered list of responses to GetVariable calls. -type fakeServer struct { - pb.RuntimeConfigManagerServer - responses []response - index int -} - -type response struct { - vrbl *pb.Variable - err error -} - -func (s *fakeServer) GetVariable(context.Context, *pb.GetVariableRequest) (*pb.Variable, error) { - if len(s.responses) == 0 { - return nil, fmt.Errorf("fakeClient missing responses") - } - resp := s.responses[s.index] - // Adjust index to next response for next call till it gets to last one, then keep using the - // last one. - if s.index < len(s.responses)-1 { - s.index++ - } - return resp.vrbl, resp.err -} - -func setUp(t *testing.T, fs *fakeServer) (*Client, func()) { - // Set up gRPC server. - lis, err := net.Listen("tcp", "localhost:0") - if err != nil { - t.Fatalf("tcp listen failed: %v", err) - } - s := grpc.NewServer() - pb.RegisterRuntimeConfigManagerServer(s, fs) - // Run gRPC server on a background goroutine. - go s.Serve(lis) - - // Set up client. - conn, err := grpc.Dial(lis.Addr().String(), grpc.WithInsecure()) - if err != nil { - t.Fatalf("did not connect: %v", err) - } - return &Client{ - conn: conn, - client: pb.NewRuntimeConfigManagerClient(conn), - }, func() { - conn.Close() - s.Stop() - time.Sleep(time.Second * 1) - } -} - -func pbToVariable(vpb *pb.Variable) (*Variable, error) { - vrbl := &Variable{} - tm, err := parseUpdateTime(vpb) - if err != nil { - return nil, err - } - copyFromProto(vpb, vrbl, tm) - return vrbl, nil -} - -var ( - startTime = time.Now().Unix() - vrbl1 = &pb.Variable{ - Name: "greetings", - Contents: &pb.Variable_Text{"hello"}, - UpdateTime: &tspb.Timestamp{Seconds: startTime}, - } - vrbl2 = &pb.Variable{ - Name: "greetings", - Contents: &pb.Variable_Text{"world"}, - UpdateTime: &tspb.Timestamp{Seconds: startTime + 100}, - } -) - -func TestNewWatcher(t *testing.T) { - client, cleanUp := setUp(t, &fakeServer{ - responses: []response{ - {vrbl: vrbl1}, - }, - }) - defer cleanUp() - - ctx := context.Background() - w, err := client.NewWatcher(ctx, "projectID", "config", "greetings", watchOpt) - if err != nil { - t.Fatalf("Client.NewWatcher() returned error: %v", err) - } - - got := w.Variable() - want, err := pbToVariable(vrbl1) - if err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(&got, want); diff != "" { - t.Errorf("Watcher.Variable(): %s", diff) - } -} - -func TestWatchUpdatesVariable(t *testing.T) { - client, cleanUp := setUp(t, &fakeServer{ - responses: []response{ - {vrbl: vrbl1}, - {vrbl: vrbl2}, - }, - }) - defer cleanUp() - - ctx := context.Background() - w, err := client.NewWatcher(ctx, "projectID", "config", "greetings", watchOpt) - if err != nil { - t.Fatalf("Client.NewWatcher() returned error: %v", err) - } - - if err := w.Watch(ctx); err != nil { - t.Fatalf("Watcher.Watch() returned error: %v", err) - } - got := w.Variable() - want, err := pbToVariable(vrbl2) - if err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(&got, want); diff != "" { - t.Errorf("Watcher.Variable(): %s", diff) - } -} - -func TestWatchVariableDeletedAndReset(t *testing.T) { - client, cleanUp := setUp(t, &fakeServer{ - responses: []response{ - {vrbl: vrbl1}, - {err: status.Error(codes.NotFound, "deleted")}, - {vrbl: vrbl2}, - }, - }) - defer cleanUp() - - ctx := context.Background() - w, err := client.NewWatcher(ctx, "projectID", "config", "greetings", watchOpt) - if err != nil { - t.Fatalf("Client.NewWatcher() returned error: %v", err) - } - - // Expect deleted error. - if err := w.Watch(ctx); err == nil { - t.Fatalf("Watcher.Watch() returned nil, want error") - } else { - if !IsDeleted(err) { - t.Fatalf("Watcher.Watch() returned error %v, want errDeleted", err) - } - } - - // Variable Name and Value should be the same, IsDeleted and UpdateTime should be updated. - got := w.Variable() - prev, err := pbToVariable(vrbl1) - if err != nil { - t.Fatal(err) - } - if got.Name != prev.Name { - t.Errorf("Variable.Name got %v, want %v", got.Name, prev.Name) - } - if diff := cmp.Diff(got.Value, prev.Value); diff != "" { - t.Errorf("Variable.Value: %s", diff) - } - if !got.IsDeleted { - t.Errorf("Variable.IsDeleted got %v, want true", got.IsDeleted) - } - if !got.UpdateTime.After(prev.UpdateTime) { - t.Errorf("Variable.UpdateTime is less than or equal to previous value") - } - - // Calling Watch again will produce vrbl2. - if err := w.Watch(ctx); err != nil { - t.Fatalf("Watcher.Watch() returned error: %v", err) - } - got = w.Variable() - want, err := pbToVariable(vrbl2) - if err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(&got, want); diff != "" { - t.Errorf("Watcher.Variable(): %s", diff) - } -} - -func TestWatchCancelled(t *testing.T) { - client, cleanUp := setUp(t, &fakeServer{ - responses: []response{ - {vrbl: vrbl1}, - }, - }) - defer cleanUp() - - ctx := context.Background() - w, err := client.NewWatcher(ctx, "projectID", "config", "greetings", watchOpt) - if err != nil { - t.Fatalf("Client.NewWatcher() returned error: %v", err) - } - - ctx, cancel := context.WithCancel(ctx) - go func() { - time.Sleep(1 * time.Second) - cancel() - }() - - if err := w.Watch(ctx); err != context.Canceled { - t.Fatalf("Watcher.Watch() returned %v, want context.Canceled", err) - } -} - -func TestWatchRPCError(t *testing.T) { - rpcErr := status.Error(codes.Internal, "bad") - client, cleanUp := setUp(t, &fakeServer{ - responses: []response{ - {vrbl: vrbl1}, - {err: rpcErr}, - }, - }) - defer cleanUp() - - ctx := context.Background() - w, err := client.NewWatcher(ctx, "projectID", "config", "greetings", watchOpt) - if err != nil { - t.Fatalf("Client.NewWatcher() returned error: %v", err) - } - - // Expect RPC error. - err = w.Watch(ctx) - if !strings.Contains(err.Error(), "bad") { - t.Errorf("Watcher.Watch() returned %v, want %v", err, rpcErr) - } - - // Variable should still be the same. - got := w.Variable() - want, err := pbToVariable(vrbl1) - if err != nil { - t.Fatal(err) - } - if diff := cmp.Diff(&got, want); diff != "" { - t.Errorf("Watcher.Variable(): %s", diff) - } -}
diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go deleted file mode 100644 index 74e09fa..0000000 --- a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/resources.pb.go +++ /dev/null
@@ -1,590 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/cloud/runtimeconfig/v1beta1/resources.proto - -/* -Package runtimeconfig is a generated protocol buffer package. - -It is generated from these files: - google/cloud/runtimeconfig/v1beta1/resources.proto - google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto - -It has these top-level messages: - RuntimeConfig - Variable - EndCondition - Waiter - ListConfigsRequest - ListConfigsResponse - GetConfigRequest - CreateConfigRequest - UpdateConfigRequest - DeleteConfigRequest - ListVariablesRequest - ListVariablesResponse - WatchVariableRequest - GetVariableRequest - CreateVariableRequest - UpdateVariableRequest - DeleteVariableRequest - ListWaitersRequest - ListWaitersResponse - GetWaiterRequest - CreateWaiterRequest - DeleteWaiterRequest -*/ -package runtimeconfig - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf1 "github.com/golang/protobuf/ptypes/duration" -import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" -import google_rpc "google.golang.org/genproto/googleapis/rpc/status" - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// The `VariableState` describes the last known state of the variable and is -// used during a `variables().watch` call to distinguish the state of the -// variable. -type VariableState int32 - -const ( - // Default variable state. - VariableState_VARIABLE_STATE_UNSPECIFIED VariableState = 0 - // The variable was updated, while `variables().watch` was executing. - VariableState_UPDATED VariableState = 1 - // The variable was deleted, while `variables().watch` was executing. - VariableState_DELETED VariableState = 2 -) - -var VariableState_name = map[int32]string{ - 0: "VARIABLE_STATE_UNSPECIFIED", - 1: "UPDATED", - 2: "DELETED", -} -var VariableState_value = map[string]int32{ - "VARIABLE_STATE_UNSPECIFIED": 0, - "UPDATED": 1, - "DELETED": 2, -} - -func (x VariableState) String() string { - return proto.EnumName(VariableState_name, int32(x)) -} -func (VariableState) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -// A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig -// service. A RuntimeConfig resource consists of metadata and a hierarchy of -// variables. -type RuntimeConfig struct { - // The resource name of a runtime config. The name must have the format: - // - // projects/[PROJECT_ID]/configs/[CONFIG_NAME] - // - // The `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an - // arbitrary name that matches RFC 1035 segment specification. The length of - // `[CONFIG_NAME]` must be less than 64 bytes. - // - // You pick the RuntimeConfig resource name, but the server will validate that - // the name adheres to this format. After you create the resource, you cannot - // change the resource's name. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // An optional description of the RuntimeConfig object. - Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` -} - -func (m *RuntimeConfig) Reset() { *m = RuntimeConfig{} } -func (m *RuntimeConfig) String() string { return proto.CompactTextString(m) } -func (*RuntimeConfig) ProtoMessage() {} -func (*RuntimeConfig) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -func (m *RuntimeConfig) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *RuntimeConfig) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -// Describes a single variable within a RuntimeConfig resource. -// The name denotes the hierarchical variable name. For example, -// `ports/serving_port` is a valid variable name. The variable value is an -// opaque string and only leaf variables can have values (that is, variables -// that do not have any child variables). -type Variable struct { - // The name of the variable resource, in the format: - // - // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME] - // - // The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a - // valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system - // file path naming. - // - // The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and - // dashes. Slashes are used as path element separators and are not part of the - // `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one - // non-slash character. Multiple slashes are coalesced into single slash - // character. Each path segment should follow RFC 1035 segment specification. - // The length of a `[VARIABLE_NAME]` must be less than 256 bytes. - // - // Once you create a variable, you cannot change the variable name. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // The the value of the variable. It can be either a binary or a string - // value. You must specify one of either `value` or `text`. Specifying both - // will cause the server to return an error. - // - // Types that are valid to be assigned to Contents: - // *Variable_Value - // *Variable_Text - Contents isVariable_Contents `protobuf_oneof:"contents"` - // [Output Only] The time of the last variable update. - UpdateTime *google_protobuf2.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime" json:"update_time,omitempty"` - // [Ouput only] The current state of the variable. The variable state indicates - // the outcome of the `variables().watch` call and is visible through the - // `get` and `list` calls. - State VariableState `protobuf:"varint,4,opt,name=state,enum=google.cloud.runtimeconfig.v1beta1.VariableState" json:"state,omitempty"` -} - -func (m *Variable) Reset() { *m = Variable{} } -func (m *Variable) String() string { return proto.CompactTextString(m) } -func (*Variable) ProtoMessage() {} -func (*Variable) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -type isVariable_Contents interface { - isVariable_Contents() -} - -type Variable_Value struct { - Value []byte `protobuf:"bytes,2,opt,name=value,proto3,oneof"` -} -type Variable_Text struct { - Text string `protobuf:"bytes,5,opt,name=text,oneof"` -} - -func (*Variable_Value) isVariable_Contents() {} -func (*Variable_Text) isVariable_Contents() {} - -func (m *Variable) GetContents() isVariable_Contents { - if m != nil { - return m.Contents - } - return nil -} - -func (m *Variable) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Variable) GetValue() []byte { - if x, ok := m.GetContents().(*Variable_Value); ok { - return x.Value - } - return nil -} - -func (m *Variable) GetText() string { - if x, ok := m.GetContents().(*Variable_Text); ok { - return x.Text - } - return "" -} - -func (m *Variable) GetUpdateTime() *google_protobuf2.Timestamp { - if m != nil { - return m.UpdateTime - } - return nil -} - -func (m *Variable) GetState() VariableState { - if m != nil { - return m.State - } - return VariableState_VARIABLE_STATE_UNSPECIFIED -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Variable) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Variable_OneofMarshaler, _Variable_OneofUnmarshaler, _Variable_OneofSizer, []interface{}{ - (*Variable_Value)(nil), - (*Variable_Text)(nil), - } -} - -func _Variable_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Variable) - // contents - switch x := m.Contents.(type) { - case *Variable_Value: - b.EncodeVarint(2<<3 | proto.WireBytes) - b.EncodeRawBytes(x.Value) - case *Variable_Text: - b.EncodeVarint(5<<3 | proto.WireBytes) - b.EncodeStringBytes(x.Text) - case nil: - default: - return fmt.Errorf("Variable.Contents has unexpected type %T", x) - } - return nil -} - -func _Variable_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Variable) - switch tag { - case 2: // contents.value - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeRawBytes(true) - m.Contents = &Variable_Value{x} - return true, err - case 5: // contents.text - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeStringBytes() - m.Contents = &Variable_Text{x} - return true, err - default: - return false, nil - } -} - -func _Variable_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Variable) - // contents - switch x := m.Contents.(type) { - case *Variable_Value: - n += proto.SizeVarint(2<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.Value))) - n += len(x.Value) - case *Variable_Text: - n += proto.SizeVarint(5<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(len(x.Text))) - n += len(x.Text) - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// The condition that a Waiter resource is waiting for. -type EndCondition struct { - // The condition oneof holds the available condition types for this - // EndCondition. Currently, the only available type is Cardinality. - // - // Types that are valid to be assigned to Condition: - // *EndCondition_Cardinality_ - Condition isEndCondition_Condition `protobuf_oneof:"condition"` -} - -func (m *EndCondition) Reset() { *m = EndCondition{} } -func (m *EndCondition) String() string { return proto.CompactTextString(m) } -func (*EndCondition) ProtoMessage() {} -func (*EndCondition) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -type isEndCondition_Condition interface { - isEndCondition_Condition() -} - -type EndCondition_Cardinality_ struct { - Cardinality *EndCondition_Cardinality `protobuf:"bytes,1,opt,name=cardinality,oneof"` -} - -func (*EndCondition_Cardinality_) isEndCondition_Condition() {} - -func (m *EndCondition) GetCondition() isEndCondition_Condition { - if m != nil { - return m.Condition - } - return nil -} - -func (m *EndCondition) GetCardinality() *EndCondition_Cardinality { - if x, ok := m.GetCondition().(*EndCondition_Cardinality_); ok { - return x.Cardinality - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*EndCondition) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _EndCondition_OneofMarshaler, _EndCondition_OneofUnmarshaler, _EndCondition_OneofSizer, []interface{}{ - (*EndCondition_Cardinality_)(nil), - } -} - -func _EndCondition_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*EndCondition) - // condition - switch x := m.Condition.(type) { - case *EndCondition_Cardinality_: - b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Cardinality); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("EndCondition.Condition has unexpected type %T", x) - } - return nil -} - -func _EndCondition_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*EndCondition) - switch tag { - case 1: // condition.cardinality - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(EndCondition_Cardinality) - err := b.DecodeMessage(msg) - m.Condition = &EndCondition_Cardinality_{msg} - return true, err - default: - return false, nil - } -} - -func _EndCondition_OneofSizer(msg proto.Message) (n int) { - m := msg.(*EndCondition) - // condition - switch x := m.Condition.(type) { - case *EndCondition_Cardinality_: - s := proto.Size(x.Cardinality) - n += proto.SizeVarint(1<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// A Cardinality condition for the Waiter resource. A cardinality condition is -// met when the number of variables under a specified path prefix reaches a -// predefined number. For example, if you set a Cardinality condition where -// the `path` is set to `/foo` and the number of paths is set to 2, the -// following variables would meet the condition in a RuntimeConfig resource: -// -// + `/foo/variable1 = "value1"` -// + `/foo/variable2 = "value2"` -// + `/bar/variable3 = "value3"` -// -// It would not would not satisify the same condition with the `number` set to -// 3, however, because there is only 2 paths that start with `/foo`. -// Cardinality conditions are recursive; all subtrees under the specific -// path prefix are counted. -type EndCondition_Cardinality struct { - // The root of the variable subtree to monitor. For example, `/foo`. - Path string `protobuf:"bytes,1,opt,name=path" json:"path,omitempty"` - // The number variables under the `path` that must exist to meet this - // condition. Defaults to 1 if not specified. - Number int32 `protobuf:"varint,2,opt,name=number" json:"number,omitempty"` -} - -func (m *EndCondition_Cardinality) Reset() { *m = EndCondition_Cardinality{} } -func (m *EndCondition_Cardinality) String() string { return proto.CompactTextString(m) } -func (*EndCondition_Cardinality) ProtoMessage() {} -func (*EndCondition_Cardinality) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } - -func (m *EndCondition_Cardinality) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *EndCondition_Cardinality) GetNumber() int32 { - if m != nil { - return m.Number - } - return 0 -} - -// A Waiter resource waits for some end condition within a RuntimeConfig resource -// to be met before it returns. For example, assume you have a distributed -// system where each node writes to a Variable resource indidicating the node's -// readiness as part of the startup process. -// -// You then configure a Waiter resource with the success condition set to wait -// until some number of nodes have checked in. Afterwards, your application -// runs some arbitrary code after the condition has been met and the waiter -// returns successfully. -// -// Once created, a Waiter resource is immutable. -// -// To learn more about using waiters, read the -// [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter) -// documentation. -type Waiter struct { - // The name of the Waiter resource, in the format: - // - // projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] - // - // The `[PROJECT_ID]` must be a valid Google Cloud project ID, - // the `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the - // `[WAITER_NAME]` must match RFC 1035 segment specification, and the length - // of `[WAITER_NAME]` must be less than 64 bytes. - // - // After you create a Waiter resource, you cannot change the resource name. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // [Required] Specifies the timeout of the waiter in seconds, beginning from - // the instant that `waiters().create` method is called. If this time elapses - // before the success or failure conditions are met, the waiter fails and sets - // the `error` code to `DEADLINE_EXCEEDED`. - Timeout *google_protobuf1.Duration `protobuf:"bytes,2,opt,name=timeout" json:"timeout,omitempty"` - // [Optional] The failure condition of this waiter. If this condition is met, - // `done` will be set to `true` and the `error` code will be set to `ABORTED`. - // The failure condition takes precedence over the success condition. If both - // conditions are met, a failure will be indicated. This value is optional; if - // no failure condition is set, the only failure scenario will be a timeout. - Failure *EndCondition `protobuf:"bytes,3,opt,name=failure" json:"failure,omitempty"` - // [Required] The success condition. If this condition is met, `done` will be - // set to `true` and the `error` value will remain unset. The failure condition - // takes precedence over the success condition. If both conditions are met, a - // failure will be indicated. - Success *EndCondition `protobuf:"bytes,4,opt,name=success" json:"success,omitempty"` - // [Output Only] The instant at which this Waiter resource was created. Adding - // the value of `timeout` to this instant yields the timeout deadline for the - // waiter. - CreateTime *google_protobuf2.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime" json:"create_time,omitempty"` - // [Output Only] If the value is `false`, it means the waiter is still waiting - // for one of its conditions to be met. - // - // If true, the waiter has finished. If the waiter finished due to a timeout - // or failure, `error` will be set. - Done bool `protobuf:"varint,6,opt,name=done" json:"done,omitempty"` - // [Output Only] If the waiter ended due to a failure or timeout, this value - // will be set. - Error *google_rpc.Status `protobuf:"bytes,7,opt,name=error" json:"error,omitempty"` -} - -func (m *Waiter) Reset() { *m = Waiter{} } -func (m *Waiter) String() string { return proto.CompactTextString(m) } -func (*Waiter) ProtoMessage() {} -func (*Waiter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *Waiter) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Waiter) GetTimeout() *google_protobuf1.Duration { - if m != nil { - return m.Timeout - } - return nil -} - -func (m *Waiter) GetFailure() *EndCondition { - if m != nil { - return m.Failure - } - return nil -} - -func (m *Waiter) GetSuccess() *EndCondition { - if m != nil { - return m.Success - } - return nil -} - -func (m *Waiter) GetCreateTime() *google_protobuf2.Timestamp { - if m != nil { - return m.CreateTime - } - return nil -} - -func (m *Waiter) GetDone() bool { - if m != nil { - return m.Done - } - return false -} - -func (m *Waiter) GetError() *google_rpc.Status { - if m != nil { - return m.Error - } - return nil -} - -func init() { - proto.RegisterType((*RuntimeConfig)(nil), "google.cloud.runtimeconfig.v1beta1.RuntimeConfig") - proto.RegisterType((*Variable)(nil), "google.cloud.runtimeconfig.v1beta1.Variable") - proto.RegisterType((*EndCondition)(nil), "google.cloud.runtimeconfig.v1beta1.EndCondition") - proto.RegisterType((*EndCondition_Cardinality)(nil), "google.cloud.runtimeconfig.v1beta1.EndCondition.Cardinality") - proto.RegisterType((*Waiter)(nil), "google.cloud.runtimeconfig.v1beta1.Waiter") - proto.RegisterEnum("google.cloud.runtimeconfig.v1beta1.VariableState", VariableState_name, VariableState_value) -} - -func init() { proto.RegisterFile("google/cloud/runtimeconfig/v1beta1/resources.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 615 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x5d, 0x6f, 0xd3, 0x3c, - 0x14, 0xc7, 0x9b, 0x3e, 0x7d, 0xd9, 0x4e, 0xb6, 0x47, 0x93, 0x85, 0x46, 0xa8, 0xd0, 0xa8, 0x7a, - 0x81, 0x2a, 0x2e, 0x12, 0xda, 0x5d, 0xa1, 0x71, 0xd3, 0x97, 0xb0, 0x15, 0x4d, 0x30, 0xb9, 0xdd, - 0x90, 0xb8, 0x19, 0xae, 0xe3, 0x85, 0x48, 0xa9, 0x1d, 0x39, 0xce, 0x04, 0xdf, 0x86, 0x6b, 0x3e, - 0x01, 0x9f, 0x86, 0x2b, 0x3e, 0x08, 0xb2, 0xe3, 0x40, 0x0b, 0x13, 0x1b, 0xdc, 0xf9, 0xf8, 0xfc, - 0xcf, 0xef, 0xbc, 0xf8, 0x24, 0x30, 0x8c, 0x85, 0x88, 0x53, 0x16, 0xd0, 0x54, 0x14, 0x51, 0x20, - 0x0b, 0xae, 0x92, 0x15, 0xa3, 0x82, 0x5f, 0x25, 0x71, 0x70, 0x3d, 0x58, 0x32, 0x45, 0x06, 0x81, - 0x64, 0xb9, 0x28, 0x24, 0x65, 0xb9, 0x9f, 0x49, 0xa1, 0x04, 0xea, 0x95, 0x31, 0xbe, 0x89, 0xf1, - 0x37, 0x62, 0x7c, 0x1b, 0xd3, 0x79, 0x68, 0xb9, 0x24, 0x4b, 0x02, 0xc2, 0xb9, 0x50, 0x44, 0x25, - 0x82, 0x5b, 0x42, 0xe7, 0xc0, 0x7a, 0x8d, 0xb5, 0x2c, 0xae, 0x82, 0xa8, 0x90, 0x46, 0x60, 0xfd, -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, 0x5c, 0x68, 0x9f, - 0x9f, 0x4d, 0x47, 0x8b, 0x70, 0xba, 0xe7, 0x68, 0x63, 0x1a, 0x9e, 0x86, 0xda, 0xa8, 0x8f, 0x3f, - 0x39, 0xf0, 0x98, 0x8a, 0xd5, 0x1d, 0xc6, 0x70, 0xe6, 0xbc, 0x7d, 0x6d, 0x55, 0xb1, 0x48, 0x09, - 0x8f, 0x7d, 0x21, 0xe3, 0x20, 0x66, 0xdc, 0xb4, 0x1a, 0x94, 0x2e, 0x92, 0x25, 0xf9, 0x9f, 0x7e, - 0x58, 0x47, 0x1b, 0xb7, 0x9f, 0xeb, 0xbd, 0xe3, 0x92, 0x38, 0x31, 0x79, 0x37, 0x7e, 0x0f, 0xfe, - 0xc5, 0x60, 0xac, 0x43, 0x96, 0x2d, 0x93, 0xe0, 0xf0, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x61, - 0xe4, 0x09, 0x63, 0x10, 0x05, 0x00, 0x00, -}
diff --git a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go b/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go deleted file mode 100644 index 3597036..0000000 --- a/vendor/google.golang.org/genproto/googleapis/cloud/runtimeconfig/v1beta1/runtimeconfig.pb.go +++ /dev/null
@@ -1,1354 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto - -package runtimeconfig - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_longrunning "google.golang.org/genproto/googleapis/longrunning" -import google_protobuf4 "github.com/golang/protobuf/ptypes/empty" -import google_protobuf2 "github.com/golang/protobuf/ptypes/timestamp" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// Request for the `ListConfigs()` method. -type ListConfigsRequest struct { - // The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) - // for this request, in the format `projects/[PROJECT_ID]`. - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // Specifies the number of results to return per page. If there are fewer - // elements than the specified number, returns all elements. - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` - // Specifies a page token to use. Set `pageToken` to a `nextPageToken` - // returned by a previous list request to get the next page of results. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` -} - -func (m *ListConfigsRequest) Reset() { *m = ListConfigsRequest{} } -func (m *ListConfigsRequest) String() string { return proto.CompactTextString(m) } -func (*ListConfigsRequest) ProtoMessage() {} -func (*ListConfigsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } - -func (m *ListConfigsRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *ListConfigsRequest) GetPageSize() int32 { - if m != nil { - return m.PageSize - } - return 0 -} - -func (m *ListConfigsRequest) GetPageToken() string { - if m != nil { - return m.PageToken - } - return "" -} - -// `ListConfigs()` returns the following response. The order of returned -// objects is arbitrary; that is, it is not ordered in any particular way. -type ListConfigsResponse struct { - // A list of the configurations in the project. The order of returned - // objects is arbitrary; that is, it is not ordered in any particular way. - Configs []*RuntimeConfig `protobuf:"bytes,1,rep,name=configs" json:"configs,omitempty"` - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `pageSize`, use the `nextPageToken` - // as a value for the query parameter `pageToken` in the next list request. - // Subsequent list requests will have their own `nextPageToken` to continue - // paging through the results - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` -} - -func (m *ListConfigsResponse) Reset() { *m = ListConfigsResponse{} } -func (m *ListConfigsResponse) String() string { return proto.CompactTextString(m) } -func (*ListConfigsResponse) ProtoMessage() {} -func (*ListConfigsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } - -func (m *ListConfigsResponse) GetConfigs() []*RuntimeConfig { - if m != nil { - return m.Configs - } - return nil -} - -func (m *ListConfigsResponse) GetNextPageToken() string { - if m != nil { - return m.NextPageToken - } - return "" -} - -// Gets a RuntimeConfig resource. -type GetConfigRequest struct { - // The name of the RuntimeConfig resource to retrieve, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` -} - -func (m *GetConfigRequest) Reset() { *m = GetConfigRequest{} } -func (m *GetConfigRequest) String() string { return proto.CompactTextString(m) } -func (*GetConfigRequest) ProtoMessage() {} -func (*GetConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } - -func (m *GetConfigRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Creates a RuntimeConfig resource. -type CreateConfigRequest struct { - // The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) - // for this request, in the format `projects/[PROJECT_ID]`. - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // The RuntimeConfig to create. - Config *RuntimeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` - // An optional but recommended unique `request_id`. If the server - // receives two `create()` requests with the same - // `request_id`, then the second request will be ignored and the - // first resource created and stored in the backend is returned. - // Empty `request_id` fields are ignored. - // - // It is responsibility of the client to ensure uniqueness of the - // `request_id` strings. - // - // `request_id` strings are limited to 64 characters. - RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` -} - -func (m *CreateConfigRequest) Reset() { *m = CreateConfigRequest{} } -func (m *CreateConfigRequest) String() string { return proto.CompactTextString(m) } -func (*CreateConfigRequest) ProtoMessage() {} -func (*CreateConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } - -func (m *CreateConfigRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *CreateConfigRequest) GetConfig() *RuntimeConfig { - if m != nil { - return m.Config - } - return nil -} - -func (m *CreateConfigRequest) GetRequestId() string { - if m != nil { - return m.RequestId - } - return "" -} - -// Request message for `UpdateConfig()` method. -type UpdateConfigRequest struct { - // The name of the RuntimeConfig resource to update, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // The config resource to update. - Config *RuntimeConfig `protobuf:"bytes,2,opt,name=config" json:"config,omitempty"` -} - -func (m *UpdateConfigRequest) Reset() { *m = UpdateConfigRequest{} } -func (m *UpdateConfigRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateConfigRequest) ProtoMessage() {} -func (*UpdateConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } - -func (m *UpdateConfigRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *UpdateConfigRequest) GetConfig() *RuntimeConfig { - if m != nil { - return m.Config - } - return nil -} - -// Request for the `DeleteConfig()` method. -type DeleteConfigRequest struct { - // The RuntimeConfig resource to delete, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *DeleteConfigRequest) Reset() { *m = DeleteConfigRequest{} } -func (m *DeleteConfigRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteConfigRequest) ProtoMessage() {} -func (*DeleteConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } - -func (m *DeleteConfigRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Request for the `ListVariables()` method. -type ListVariablesRequest struct { - // The path to the RuntimeConfig resource for which you want to list variables. - // The configuration must exist beforehand; the path must by in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // Filters variables by matching the specified filter. For example: - // - // `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. - Filter string `protobuf:"bytes,2,opt,name=filter" json:"filter,omitempty"` - // Specifies the number of results to return per page. If there are fewer - // elements than the specified number, returns all elements. - PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` - // Specifies a page token to use. Set `pageToken` to a `nextPageToken` - // returned by a previous list request to get the next page of results. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` - // The flag indicates whether the user wants to return values of variables. - // If true, then only those variables that user has IAM GetVariable permission - // will be returned along with their values. - ReturnValues bool `protobuf:"varint,5,opt,name=return_values,json=returnValues" json:"return_values,omitempty"` -} - -func (m *ListVariablesRequest) Reset() { *m = ListVariablesRequest{} } -func (m *ListVariablesRequest) String() string { return proto.CompactTextString(m) } -func (*ListVariablesRequest) ProtoMessage() {} -func (*ListVariablesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } - -func (m *ListVariablesRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *ListVariablesRequest) GetFilter() string { - if m != nil { - return m.Filter - } - return "" -} - -func (m *ListVariablesRequest) GetPageSize() int32 { - if m != nil { - return m.PageSize - } - return 0 -} - -func (m *ListVariablesRequest) GetPageToken() string { - if m != nil { - return m.PageToken - } - return "" -} - -func (m *ListVariablesRequest) GetReturnValues() bool { - if m != nil { - return m.ReturnValues - } - return false -} - -// Response for the `ListVariables()` method. -type ListVariablesResponse struct { - // A list of variables and their values. The order of returned variable - // objects is arbitrary. - Variables []*Variable `protobuf:"bytes,1,rep,name=variables" json:"variables,omitempty"` - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `pageSize`, use the `nextPageToken` - // as a value for the query parameter `pageToken` in the next list request. - // Subsequent list requests will have their own `nextPageToken` to continue - // paging through the results - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` -} - -func (m *ListVariablesResponse) Reset() { *m = ListVariablesResponse{} } -func (m *ListVariablesResponse) String() string { return proto.CompactTextString(m) } -func (*ListVariablesResponse) ProtoMessage() {} -func (*ListVariablesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } - -func (m *ListVariablesResponse) GetVariables() []*Variable { - if m != nil { - return m.Variables - } - return nil -} - -func (m *ListVariablesResponse) GetNextPageToken() string { - if m != nil { - return m.NextPageToken - } - return "" -} - -// Request for the `WatchVariable()` method. -type WatchVariableRequest struct { - // The name of the variable to watch, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // If specified, checks the current timestamp of the variable and if the - // current timestamp is newer than `newerThan` timestamp, the method returns - // immediately. - // - // If not specified or the variable has an older timestamp, the watcher waits - // for a the value to change before returning. - NewerThan *google_protobuf2.Timestamp `protobuf:"bytes,4,opt,name=newer_than,json=newerThan" json:"newer_than,omitempty"` -} - -func (m *WatchVariableRequest) Reset() { *m = WatchVariableRequest{} } -func (m *WatchVariableRequest) String() string { return proto.CompactTextString(m) } -func (*WatchVariableRequest) ProtoMessage() {} -func (*WatchVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } - -func (m *WatchVariableRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *WatchVariableRequest) GetNewerThan() *google_protobuf2.Timestamp { - if m != nil { - return m.NewerThan - } - return nil -} - -// Request for the `GetVariable()` method. -type GetVariableRequest struct { - // The name of the variable to return, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *GetVariableRequest) Reset() { *m = GetVariableRequest{} } -func (m *GetVariableRequest) String() string { return proto.CompactTextString(m) } -func (*GetVariableRequest) ProtoMessage() {} -func (*GetVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } - -func (m *GetVariableRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Request for the `CreateVariable()` method. -type CreateVariableRequest struct { - // The path to the RutimeConfig resource that this variable should belong to. - // The configuration must exist beforehand; the path must by in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // The variable to create. - Variable *Variable `protobuf:"bytes,2,opt,name=variable" json:"variable,omitempty"` - // An optional but recommended unique `request_id`. If the server - // receives two `create()` requests with the same - // `request_id`, then the second request will be ignored and the - // first resource created and stored in the backend is returned. - // Empty `request_id` fields are ignored. - // - // It is responsibility of the client to ensure uniqueness of the - // `request_id` strings. - // - // `request_id` strings are limited to 64 characters. - RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` -} - -func (m *CreateVariableRequest) Reset() { *m = CreateVariableRequest{} } -func (m *CreateVariableRequest) String() string { return proto.CompactTextString(m) } -func (*CreateVariableRequest) ProtoMessage() {} -func (*CreateVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} } - -func (m *CreateVariableRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *CreateVariableRequest) GetVariable() *Variable { - if m != nil { - return m.Variable - } - return nil -} - -func (m *CreateVariableRequest) GetRequestId() string { - if m != nil { - return m.RequestId - } - return "" -} - -// Request for the `UpdateVariable()` method. -type UpdateVariableRequest struct { - // The name of the variable to update, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // The variable to update. - Variable *Variable `protobuf:"bytes,2,opt,name=variable" json:"variable,omitempty"` -} - -func (m *UpdateVariableRequest) Reset() { *m = UpdateVariableRequest{} } -func (m *UpdateVariableRequest) String() string { return proto.CompactTextString(m) } -func (*UpdateVariableRequest) ProtoMessage() {} -func (*UpdateVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} } - -func (m *UpdateVariableRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *UpdateVariableRequest) GetVariable() *Variable { - if m != nil { - return m.Variable - } - return nil -} - -// Request for the `DeleteVariable()` method. -type DeleteVariableRequest struct { - // The name of the variable to delete, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Set to `true` to recursively delete multiple variables with the same - // prefix. - Recursive bool `protobuf:"varint,2,opt,name=recursive" json:"recursive,omitempty"` -} - -func (m *DeleteVariableRequest) Reset() { *m = DeleteVariableRequest{} } -func (m *DeleteVariableRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteVariableRequest) ProtoMessage() {} -func (*DeleteVariableRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{12} } - -func (m *DeleteVariableRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *DeleteVariableRequest) GetRecursive() bool { - if m != nil { - return m.Recursive - } - return false -} - -// Request for the `ListWaiters()` method. -type ListWaitersRequest struct { - // The path to the configuration for which you want to get a list of waiters. - // The configuration must exist beforehand; the path must by in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // Specifies the number of results to return per page. If there are fewer - // elements than the specified number, returns all elements. - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` - // Specifies a page token to use. Set `pageToken` to a `nextPageToken` - // returned by a previous list request to get the next page of results. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` -} - -func (m *ListWaitersRequest) Reset() { *m = ListWaitersRequest{} } -func (m *ListWaitersRequest) String() string { return proto.CompactTextString(m) } -func (*ListWaitersRequest) ProtoMessage() {} -func (*ListWaitersRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{13} } - -func (m *ListWaitersRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *ListWaitersRequest) GetPageSize() int32 { - if m != nil { - return m.PageSize - } - return 0 -} - -func (m *ListWaitersRequest) GetPageToken() string { - if m != nil { - return m.PageToken - } - return "" -} - -// Response for the `ListWaiters()` method. -// Order of returned waiter objects is arbitrary. -type ListWaitersResponse struct { - // Found waiters in the project. - Waiters []*Waiter `protobuf:"bytes,1,rep,name=waiters" json:"waiters,omitempty"` - // This token allows you to get the next page of results for list requests. - // If the number of results is larger than `pageSize`, use the `nextPageToken` - // as a value for the query parameter `pageToken` in the next list request. - // Subsequent list requests will have their own `nextPageToken` to continue - // paging through the results - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` -} - -func (m *ListWaitersResponse) Reset() { *m = ListWaitersResponse{} } -func (m *ListWaitersResponse) String() string { return proto.CompactTextString(m) } -func (*ListWaitersResponse) ProtoMessage() {} -func (*ListWaitersResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{14} } - -func (m *ListWaitersResponse) GetWaiters() []*Waiter { - if m != nil { - return m.Waiters - } - return nil -} - -func (m *ListWaitersResponse) GetNextPageToken() string { - if m != nil { - return m.NextPageToken - } - return "" -} - -// Request for the `GetWaiter()` method. -type GetWaiterRequest struct { - // The fully-qualified name of the Waiter resource object to retrieve, in the - // format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *GetWaiterRequest) Reset() { *m = GetWaiterRequest{} } -func (m *GetWaiterRequest) String() string { return proto.CompactTextString(m) } -func (*GetWaiterRequest) ProtoMessage() {} -func (*GetWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{15} } - -func (m *GetWaiterRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// Request message for `CreateWaiter()` method. -type CreateWaiterRequest struct { - // The path to the configuration that will own the waiter. - // The configuration must exist beforehand; the path must by in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. - Parent string `protobuf:"bytes,1,opt,name=parent" json:"parent,omitempty"` - // The Waiter resource to create. - Waiter *Waiter `protobuf:"bytes,2,opt,name=waiter" json:"waiter,omitempty"` - // An optional but recommended unique `request_id`. If the server - // receives two `create()` requests with the same - // `request_id`, then the second request will be ignored and the - // first resource created and stored in the backend is returned. - // Empty `request_id` fields are ignored. - // - // It is responsibility of the client to ensure uniqueness of the - // `request_id` strings. - // - // `request_id` strings are limited to 64 characters. - RequestId string `protobuf:"bytes,3,opt,name=request_id,json=requestId" json:"request_id,omitempty"` -} - -func (m *CreateWaiterRequest) Reset() { *m = CreateWaiterRequest{} } -func (m *CreateWaiterRequest) String() string { return proto.CompactTextString(m) } -func (*CreateWaiterRequest) ProtoMessage() {} -func (*CreateWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{16} } - -func (m *CreateWaiterRequest) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} - -func (m *CreateWaiterRequest) GetWaiter() *Waiter { - if m != nil { - return m.Waiter - } - return nil -} - -func (m *CreateWaiterRequest) GetRequestId() string { - if m != nil { - return m.RequestId - } - return "" -} - -// Request for the `DeleteWaiter()` method. -type DeleteWaiterRequest struct { - // The Waiter resource to delete, in the format: - // - // `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *DeleteWaiterRequest) Reset() { *m = DeleteWaiterRequest{} } -func (m *DeleteWaiterRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteWaiterRequest) ProtoMessage() {} -func (*DeleteWaiterRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{17} } - -func (m *DeleteWaiterRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func init() { - proto.RegisterType((*ListConfigsRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListConfigsRequest") - proto.RegisterType((*ListConfigsResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListConfigsResponse") - proto.RegisterType((*GetConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetConfigRequest") - proto.RegisterType((*CreateConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateConfigRequest") - proto.RegisterType((*UpdateConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.UpdateConfigRequest") - proto.RegisterType((*DeleteConfigRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteConfigRequest") - proto.RegisterType((*ListVariablesRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListVariablesRequest") - proto.RegisterType((*ListVariablesResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListVariablesResponse") - proto.RegisterType((*WatchVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.WatchVariableRequest") - proto.RegisterType((*GetVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetVariableRequest") - proto.RegisterType((*CreateVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateVariableRequest") - proto.RegisterType((*UpdateVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.UpdateVariableRequest") - proto.RegisterType((*DeleteVariableRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteVariableRequest") - proto.RegisterType((*ListWaitersRequest)(nil), "google.cloud.runtimeconfig.v1beta1.ListWaitersRequest") - proto.RegisterType((*ListWaitersResponse)(nil), "google.cloud.runtimeconfig.v1beta1.ListWaitersResponse") - proto.RegisterType((*GetWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.GetWaiterRequest") - proto.RegisterType((*CreateWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.CreateWaiterRequest") - proto.RegisterType((*DeleteWaiterRequest)(nil), "google.cloud.runtimeconfig.v1beta1.DeleteWaiterRequest") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for RuntimeConfigManager service - -type RuntimeConfigManagerClient interface { - // Lists all the RuntimeConfig resources within project. - ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) - // Gets information about a RuntimeConfig resource. - GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) - // Creates a new RuntimeConfig resource. The configuration name must be - // unique within project. - CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) - // Updates a RuntimeConfig resource. The configuration must exist beforehand. - UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) - // Deletes a RuntimeConfig resource. - DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) - // Lists variables within given a configuration, matching any provided filters. - // This only lists variable names, not the values, unless `return_values` is - // true, in which case only variables that user has IAM permission to - // GetVariable will be returned. - ListVariables(ctx context.Context, in *ListVariablesRequest, opts ...grpc.CallOption) (*ListVariablesResponse, error) - // Gets information about a single variable. - GetVariable(ctx context.Context, in *GetVariableRequest, opts ...grpc.CallOption) (*Variable, error) - // Watches a specific variable and waits for a change in the variable's value. - // When there is a change, this method returns the new value or times out. - // - // If a variable is deleted while being watched, the `variableState` state is - // set to `DELETED` and the method returns the last known variable `value`. - // - // If you set the deadline for watching to a larger value than internal timeout - // (60 seconds), the current variable value is returned and the `variableState` - // will be `VARIABLE_STATE_UNSPECIFIED`. - // - // To learn more about creating a watcher, read the - // [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) - // documentation. - WatchVariable(ctx context.Context, in *WatchVariableRequest, opts ...grpc.CallOption) (*Variable, error) - // Creates a variable within the given configuration. You cannot create - // a variable with a name that is a prefix of an existing variable name, or a - // name that has an existing variable name as a prefix. - // - // To learn more about creating a variable, read the - // [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) - // documentation. - CreateVariable(ctx context.Context, in *CreateVariableRequest, opts ...grpc.CallOption) (*Variable, error) - // Updates an existing variable with a new value. - UpdateVariable(ctx context.Context, in *UpdateVariableRequest, opts ...grpc.CallOption) (*Variable, error) - // Deletes a variable or multiple variables. - // - // If you specify a variable name, then that variable is deleted. If you - // specify a prefix and `recursive` is true, then all variables with that - // prefix are deleted. You must set a `recursive` to true if you delete - // variables by prefix. - DeleteVariable(ctx context.Context, in *DeleteVariableRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) - // List waiters within the given configuration. - ListWaiters(ctx context.Context, in *ListWaitersRequest, opts ...grpc.CallOption) (*ListWaitersResponse, error) - // Gets information about a single waiter. - GetWaiter(ctx context.Context, in *GetWaiterRequest, opts ...grpc.CallOption) (*Waiter, error) - // Creates a Waiter resource. This operation returns a long-running Operation - // resource which can be polled for completion. However, a waiter with the - // given name will exist (and can be retrieved) prior to the operation - // completing. If the operation fails, the failed Waiter resource will - // still exist and must be deleted prior to subsequent creation attempts. - CreateWaiter(ctx context.Context, in *CreateWaiterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) - // Deletes the waiter with the specified name. - DeleteWaiter(ctx context.Context, in *DeleteWaiterRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) -} - -type runtimeConfigManagerClient struct { - cc *grpc.ClientConn -} - -func NewRuntimeConfigManagerClient(cc *grpc.ClientConn) RuntimeConfigManagerClient { - return &runtimeConfigManagerClient{cc} -} - -func (c *runtimeConfigManagerClient) ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) { - out := new(ListConfigsResponse) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListConfigs", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { - out := new(RuntimeConfig) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetConfig", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { - out := new(RuntimeConfig) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateConfig", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*RuntimeConfig, error) { - out := new(RuntimeConfig) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateConfig", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { - out := new(google_protobuf4.Empty) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteConfig", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) ListVariables(ctx context.Context, in *ListVariablesRequest, opts ...grpc.CallOption) (*ListVariablesResponse, error) { - out := new(ListVariablesResponse) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListVariables", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) GetVariable(ctx context.Context, in *GetVariableRequest, opts ...grpc.CallOption) (*Variable, error) { - out := new(Variable) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetVariable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) WatchVariable(ctx context.Context, in *WatchVariableRequest, opts ...grpc.CallOption) (*Variable, error) { - out := new(Variable) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/WatchVariable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) CreateVariable(ctx context.Context, in *CreateVariableRequest, opts ...grpc.CallOption) (*Variable, error) { - out := new(Variable) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateVariable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) UpdateVariable(ctx context.Context, in *UpdateVariableRequest, opts ...grpc.CallOption) (*Variable, error) { - out := new(Variable) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateVariable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) DeleteVariable(ctx context.Context, in *DeleteVariableRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { - out := new(google_protobuf4.Empty) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteVariable", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) ListWaiters(ctx context.Context, in *ListWaitersRequest, opts ...grpc.CallOption) (*ListWaitersResponse, error) { - out := new(ListWaitersResponse) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListWaiters", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) GetWaiter(ctx context.Context, in *GetWaiterRequest, opts ...grpc.CallOption) (*Waiter, error) { - out := new(Waiter) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetWaiter", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) CreateWaiter(ctx context.Context, in *CreateWaiterRequest, opts ...grpc.CallOption) (*google_longrunning.Operation, error) { - out := new(google_longrunning.Operation) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateWaiter", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeConfigManagerClient) DeleteWaiter(ctx context.Context, in *DeleteWaiterRequest, opts ...grpc.CallOption) (*google_protobuf4.Empty, error) { - out := new(google_protobuf4.Empty) - err := grpc.Invoke(ctx, "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteWaiter", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for RuntimeConfigManager service - -type RuntimeConfigManagerServer interface { - // Lists all the RuntimeConfig resources within project. - ListConfigs(context.Context, *ListConfigsRequest) (*ListConfigsResponse, error) - // Gets information about a RuntimeConfig resource. - GetConfig(context.Context, *GetConfigRequest) (*RuntimeConfig, error) - // Creates a new RuntimeConfig resource. The configuration name must be - // unique within project. - CreateConfig(context.Context, *CreateConfigRequest) (*RuntimeConfig, error) - // Updates a RuntimeConfig resource. The configuration must exist beforehand. - UpdateConfig(context.Context, *UpdateConfigRequest) (*RuntimeConfig, error) - // Deletes a RuntimeConfig resource. - DeleteConfig(context.Context, *DeleteConfigRequest) (*google_protobuf4.Empty, error) - // Lists variables within given a configuration, matching any provided filters. - // This only lists variable names, not the values, unless `return_values` is - // true, in which case only variables that user has IAM permission to - // GetVariable will be returned. - ListVariables(context.Context, *ListVariablesRequest) (*ListVariablesResponse, error) - // Gets information about a single variable. - GetVariable(context.Context, *GetVariableRequest) (*Variable, error) - // Watches a specific variable and waits for a change in the variable's value. - // When there is a change, this method returns the new value or times out. - // - // If a variable is deleted while being watched, the `variableState` state is - // set to `DELETED` and the method returns the last known variable `value`. - // - // If you set the deadline for watching to a larger value than internal timeout - // (60 seconds), the current variable value is returned and the `variableState` - // will be `VARIABLE_STATE_UNSPECIFIED`. - // - // To learn more about creating a watcher, read the - // [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable) - // documentation. - WatchVariable(context.Context, *WatchVariableRequest) (*Variable, error) - // Creates a variable within the given configuration. You cannot create - // a variable with a name that is a prefix of an existing variable name, or a - // name that has an existing variable name as a prefix. - // - // To learn more about creating a variable, read the - // [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables) - // documentation. - CreateVariable(context.Context, *CreateVariableRequest) (*Variable, error) - // Updates an existing variable with a new value. - UpdateVariable(context.Context, *UpdateVariableRequest) (*Variable, error) - // Deletes a variable or multiple variables. - // - // If you specify a variable name, then that variable is deleted. If you - // specify a prefix and `recursive` is true, then all variables with that - // prefix are deleted. You must set a `recursive` to true if you delete - // variables by prefix. - DeleteVariable(context.Context, *DeleteVariableRequest) (*google_protobuf4.Empty, error) - // List waiters within the given configuration. - ListWaiters(context.Context, *ListWaitersRequest) (*ListWaitersResponse, error) - // Gets information about a single waiter. - GetWaiter(context.Context, *GetWaiterRequest) (*Waiter, error) - // Creates a Waiter resource. This operation returns a long-running Operation - // resource which can be polled for completion. However, a waiter with the - // given name will exist (and can be retrieved) prior to the operation - // completing. If the operation fails, the failed Waiter resource will - // still exist and must be deleted prior to subsequent creation attempts. - CreateWaiter(context.Context, *CreateWaiterRequest) (*google_longrunning.Operation, error) - // Deletes the waiter with the specified name. - DeleteWaiter(context.Context, *DeleteWaiterRequest) (*google_protobuf4.Empty, error) -} - -func RegisterRuntimeConfigManagerServer(s *grpc.Server, srv RuntimeConfigManagerServer) { - s.RegisterService(&_RuntimeConfigManager_serviceDesc, srv) -} - -func _RuntimeConfigManager_ListConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListConfigsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).ListConfigs(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListConfigs", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).ListConfigs(ctx, req.(*ListConfigsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).GetConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).GetConfig(ctx, req.(*GetConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_CreateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).CreateConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).CreateConfig(ctx, req.(*CreateConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).UpdateConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).UpdateConfig(ctx, req.(*UpdateConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_DeleteConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteConfigRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).DeleteConfig(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteConfig", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).DeleteConfig(ctx, req.(*DeleteConfigRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_ListVariables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListVariablesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).ListVariables(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListVariables", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).ListVariables(ctx, req.(*ListVariablesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_GetVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVariableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).GetVariable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetVariable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).GetVariable(ctx, req.(*GetVariableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_WatchVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(WatchVariableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).WatchVariable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/WatchVariable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).WatchVariable(ctx, req.(*WatchVariableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_CreateVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateVariableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).CreateVariable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateVariable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).CreateVariable(ctx, req.(*CreateVariableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_UpdateVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateVariableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).UpdateVariable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/UpdateVariable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).UpdateVariable(ctx, req.(*UpdateVariableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_DeleteVariable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteVariableRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).DeleteVariable(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteVariable", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).DeleteVariable(ctx, req.(*DeleteVariableRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_ListWaiters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListWaitersRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).ListWaiters(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/ListWaiters", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).ListWaiters(ctx, req.(*ListWaitersRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_GetWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetWaiterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).GetWaiter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/GetWaiter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).GetWaiter(ctx, req.(*GetWaiterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_CreateWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateWaiterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).CreateWaiter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/CreateWaiter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).CreateWaiter(ctx, req.(*CreateWaiterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RuntimeConfigManager_DeleteWaiter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteWaiterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeConfigManagerServer).DeleteWaiter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager/DeleteWaiter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeConfigManagerServer).DeleteWaiter(ctx, req.(*DeleteWaiterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _RuntimeConfigManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.cloud.runtimeconfig.v1beta1.RuntimeConfigManager", - HandlerType: (*RuntimeConfigManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListConfigs", - Handler: _RuntimeConfigManager_ListConfigs_Handler, - }, - { - MethodName: "GetConfig", - Handler: _RuntimeConfigManager_GetConfig_Handler, - }, - { - MethodName: "CreateConfig", - Handler: _RuntimeConfigManager_CreateConfig_Handler, - }, - { - MethodName: "UpdateConfig", - Handler: _RuntimeConfigManager_UpdateConfig_Handler, - }, - { - MethodName: "DeleteConfig", - Handler: _RuntimeConfigManager_DeleteConfig_Handler, - }, - { - MethodName: "ListVariables", - Handler: _RuntimeConfigManager_ListVariables_Handler, - }, - { - MethodName: "GetVariable", - Handler: _RuntimeConfigManager_GetVariable_Handler, - }, - { - MethodName: "WatchVariable", - Handler: _RuntimeConfigManager_WatchVariable_Handler, - }, - { - MethodName: "CreateVariable", - Handler: _RuntimeConfigManager_CreateVariable_Handler, - }, - { - MethodName: "UpdateVariable", - Handler: _RuntimeConfigManager_UpdateVariable_Handler, - }, - { - MethodName: "DeleteVariable", - Handler: _RuntimeConfigManager_DeleteVariable_Handler, - }, - { - MethodName: "ListWaiters", - Handler: _RuntimeConfigManager_ListWaiters_Handler, - }, - { - MethodName: "GetWaiter", - Handler: _RuntimeConfigManager_GetWaiter_Handler, - }, - { - MethodName: "CreateWaiter", - Handler: _RuntimeConfigManager_CreateWaiter_Handler, - }, - { - MethodName: "DeleteWaiter", - Handler: _RuntimeConfigManager_DeleteWaiter_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto", -} - -func init() { - proto.RegisterFile("google/cloud/runtimeconfig/v1beta1/runtimeconfig.proto", fileDescriptor1) -} - -var fileDescriptor1 = []byte{ - // 1144 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0x5b, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0x35, 0x69, 0x9b, 0x66, 0x4f, 0x2e, 0xa0, 0xc9, 0x45, 0x91, 0xdb, 0x8a, 0xc8, 0x45, - 0x51, 0x58, 0x55, 0x76, 0x93, 0x56, 0x69, 0x12, 0x28, 0x0f, 0x49, 0x51, 0x08, 0x17, 0xb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b, 0x13, 0x00, 0x00, -}
diff --git a/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go b/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go deleted file mode 100644 index 4f947fe..0000000 --- a/vendor/google.golang.org/genproto/googleapis/longrunning/operations.pb.go +++ /dev/null
@@ -1,596 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/longrunning/operations.proto - -/* -Package longrunning is a generated protocol buffer package. - -It is generated from these files: - google/longrunning/operations.proto - -It has these top-level messages: - Operation - GetOperationRequest - ListOperationsRequest - ListOperationsResponse - CancelOperationRequest - DeleteOperationRequest -*/ -package longrunning - -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "google.golang.org/genproto/googleapis/api/annotations" -import google_protobuf1 "github.com/golang/protobuf/ptypes/any" -import google_protobuf2 "github.com/golang/protobuf/ptypes/empty" -import google_rpc "google.golang.org/genproto/googleapis/rpc/status" - -import ( - context "golang.org/x/net/context" - grpc "google.golang.org/grpc" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - -// This resource represents a long-running operation that is the result of a -// network API call. -type Operation struct { - // The server-assigned name, which is only unique within the same service that - // originally returns it. If you use the default HTTP mapping, the - // `name` should have the format of `operations/some/unique/name`. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // Service-specific metadata associated with the operation. It typically - // contains progress information and common metadata such as create time. - // Some services might not provide such metadata. Any method that returns a - // long-running operation should document the metadata type, if any. - Metadata *google_protobuf1.Any `protobuf:"bytes,2,opt,name=metadata" json:"metadata,omitempty"` - // If the value is `false`, it means the operation is still in progress. - // If true, the operation is completed, and either `error` or `response` is - // available. - Done bool `protobuf:"varint,3,opt,name=done" json:"done,omitempty"` - // The operation result, which can be either an `error` or a valid `response`. - // If `done` == `false`, neither `error` nor `response` is set. - // If `done` == `true`, exactly one of `error` or `response` is set. - // - // Types that are valid to be assigned to Result: - // *Operation_Error - // *Operation_Response - Result isOperation_Result `protobuf_oneof:"result"` -} - -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } - -type isOperation_Result interface { - isOperation_Result() -} - -type Operation_Error struct { - Error *google_rpc.Status `protobuf:"bytes,4,opt,name=error,oneof"` -} -type Operation_Response struct { - Response *google_protobuf1.Any `protobuf:"bytes,5,opt,name=response,oneof"` -} - -func (*Operation_Error) isOperation_Result() {} -func (*Operation_Response) isOperation_Result() {} - -func (m *Operation) GetResult() isOperation_Result { - if m != nil { - return m.Result - } - return nil -} - -func (m *Operation) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *Operation) GetMetadata() *google_protobuf1.Any { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *Operation) GetDone() bool { - if m != nil { - return m.Done - } - return false -} - -func (m *Operation) GetError() *google_rpc.Status { - if x, ok := m.GetResult().(*Operation_Error); ok { - return x.Error - } - return nil -} - -func (m *Operation) GetResponse() *google_protobuf1.Any { - if x, ok := m.GetResult().(*Operation_Response); ok { - return x.Response - } - return nil -} - -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Operation) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Operation_OneofMarshaler, _Operation_OneofUnmarshaler, _Operation_OneofSizer, []interface{}{ - (*Operation_Error)(nil), - (*Operation_Response)(nil), - } -} - -func _Operation_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Operation) - // result - switch x := m.Result.(type) { - case *Operation_Error: - b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Error); err != nil { - return err - } - case *Operation_Response: - b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Response); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Operation.Result has unexpected type %T", x) - } - return nil -} - -func _Operation_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Operation) - switch tag { - case 4: // result.error - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(google_rpc.Status) - err := b.DecodeMessage(msg) - m.Result = &Operation_Error{msg} - return true, err - case 5: // result.response - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(google_protobuf1.Any) - err := b.DecodeMessage(msg) - m.Result = &Operation_Response{msg} - return true, err - default: - return false, nil - } -} - -func _Operation_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Operation) - // result - switch x := m.Result.(type) { - case *Operation_Error: - s := proto.Size(x.Error) - n += proto.SizeVarint(4<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case *Operation_Response: - s := proto.Size(x.Response) - n += proto.SizeVarint(5<<3 | proto.WireBytes) - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - -// The request message for [Operations.GetOperation][google.longrunning.Operations.GetOperation]. -type GetOperationRequest struct { - // The name of the operation resource. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *GetOperationRequest) Reset() { *m = GetOperationRequest{} } -func (m *GetOperationRequest) String() string { return proto.CompactTextString(m) } -func (*GetOperationRequest) ProtoMessage() {} -func (*GetOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } - -func (m *GetOperationRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// The request message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. -type ListOperationsRequest struct { - // The name of the operation collection. - Name string `protobuf:"bytes,4,opt,name=name" json:"name,omitempty"` - // The standard list filter. - Filter string `protobuf:"bytes,1,opt,name=filter" json:"filter,omitempty"` - // The standard list page size. - PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize" json:"page_size,omitempty"` - // The standard list page token. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken" json:"page_token,omitempty"` -} - -func (m *ListOperationsRequest) Reset() { *m = ListOperationsRequest{} } -func (m *ListOperationsRequest) String() string { return proto.CompactTextString(m) } -func (*ListOperationsRequest) ProtoMessage() {} -func (*ListOperationsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } - -func (m *ListOperationsRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ListOperationsRequest) GetFilter() string { - if m != nil { - return m.Filter - } - return "" -} - -func (m *ListOperationsRequest) GetPageSize() int32 { - if m != nil { - return m.PageSize - } - return 0 -} - -func (m *ListOperationsRequest) GetPageToken() string { - if m != nil { - return m.PageToken - } - return "" -} - -// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. -type ListOperationsResponse struct { - // A list of operations that matches the specified filter in the request. - Operations []*Operation `protobuf:"bytes,1,rep,name=operations" json:"operations,omitempty"` - // The standard List next-page token. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken" json:"next_page_token,omitempty"` -} - -func (m *ListOperationsResponse) Reset() { *m = ListOperationsResponse{} } -func (m *ListOperationsResponse) String() string { return proto.CompactTextString(m) } -func (*ListOperationsResponse) ProtoMessage() {} -func (*ListOperationsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *ListOperationsResponse) GetOperations() []*Operation { - if m != nil { - return m.Operations - } - return nil -} - -func (m *ListOperationsResponse) GetNextPageToken() string { - if m != nil { - return m.NextPageToken - } - return "" -} - -// The request message for [Operations.CancelOperation][google.longrunning.Operations.CancelOperation]. -type CancelOperationRequest struct { - // The name of the operation resource to be cancelled. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *CancelOperationRequest) Reset() { *m = CancelOperationRequest{} } -func (m *CancelOperationRequest) String() string { return proto.CompactTextString(m) } -func (*CancelOperationRequest) ProtoMessage() {} -func (*CancelOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } - -func (m *CancelOperationRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -// The request message for [Operations.DeleteOperation][google.longrunning.Operations.DeleteOperation]. -type DeleteOperationRequest struct { - // The name of the operation resource to be deleted. - Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` -} - -func (m *DeleteOperationRequest) Reset() { *m = DeleteOperationRequest{} } -func (m *DeleteOperationRequest) String() string { return proto.CompactTextString(m) } -func (*DeleteOperationRequest) ProtoMessage() {} -func (*DeleteOperationRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } - -func (m *DeleteOperationRequest) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func init() { - proto.RegisterType((*Operation)(nil), "google.longrunning.Operation") - proto.RegisterType((*GetOperationRequest)(nil), "google.longrunning.GetOperationRequest") - proto.RegisterType((*ListOperationsRequest)(nil), "google.longrunning.ListOperationsRequest") - proto.RegisterType((*ListOperationsResponse)(nil), "google.longrunning.ListOperationsResponse") - proto.RegisterType((*CancelOperationRequest)(nil), "google.longrunning.CancelOperationRequest") - proto.RegisterType((*DeleteOperationRequest)(nil), "google.longrunning.DeleteOperationRequest") -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// Client API for Operations service - -type OperationsClient interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - // - // NOTE: the `name` binding below allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. - ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) -} - -type operationsClient struct { - cc *grpc.ClientConn -} - -func NewOperationsClient(cc *grpc.ClientConn) OperationsClient { - return &operationsClient{cc} -} - -func (c *operationsClient) ListOperations(ctx context.Context, in *ListOperationsRequest, opts ...grpc.CallOption) (*ListOperationsResponse, error) { - out := new(ListOperationsResponse) - err := grpc.Invoke(ctx, "/google.longrunning.Operations/ListOperations", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) GetOperation(ctx context.Context, in *GetOperationRequest, opts ...grpc.CallOption) (*Operation, error) { - out := new(Operation) - err := grpc.Invoke(ctx, "/google.longrunning.Operations/GetOperation", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) DeleteOperation(ctx context.Context, in *DeleteOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { - out := new(google_protobuf2.Empty) - err := grpc.Invoke(ctx, "/google.longrunning.Operations/DeleteOperation", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *operationsClient) CancelOperation(ctx context.Context, in *CancelOperationRequest, opts ...grpc.CallOption) (*google_protobuf2.Empty, error) { - out := new(google_protobuf2.Empty) - err := grpc.Invoke(ctx, "/google.longrunning.Operations/CancelOperation", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for Operations service - -type OperationsServer interface { - // Lists operations that match the specified filter in the request. If the - // server doesn't support this method, it returns `UNIMPLEMENTED`. - // - // NOTE: the `name` binding below allows API services to override the binding - // to use different resource name schemes, such as `users/*/operations`. - ListOperations(context.Context, *ListOperationsRequest) (*ListOperationsResponse, error) - // Gets the latest state of a long-running operation. Clients can use this - // method to poll the operation result at intervals as recommended by the API - // service. - GetOperation(context.Context, *GetOperationRequest) (*Operation, error) - // Deletes a long-running operation. This method indicates that the client is - // no longer interested in the operation result. It does not cancel the - // operation. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. - DeleteOperation(context.Context, *DeleteOperationRequest) (*google_protobuf2.Empty, error) - // Starts asynchronous cancellation on a long-running operation. The server - // makes a best effort to cancel the operation, but success is not - // guaranteed. If the server doesn't support this method, it returns - // `google.rpc.Code.UNIMPLEMENTED`. Clients can use - // [Operations.GetOperation][google.longrunning.Operations.GetOperation] or - // other methods to check whether the cancellation succeeded or whether the - // operation completed despite cancellation. On successful cancellation, - // the operation is not deleted; instead, it becomes an operation with - // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. - CancelOperation(context.Context, *CancelOperationRequest) (*google_protobuf2.Empty, error) -} - -func RegisterOperationsServer(s *grpc.Server, srv OperationsServer) { - s.RegisterService(&_Operations_serviceDesc, srv) -} - -func _Operations_ListOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).ListOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/ListOperations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).ListOperations(ctx, req.(*ListOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_GetOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).GetOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/GetOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).GetOperation(ctx, req.(*GetOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_DeleteOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).DeleteOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/DeleteOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).DeleteOperation(ctx, req.(*DeleteOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Operations_CancelOperation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CancelOperationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(OperationsServer).CancelOperation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/google.longrunning.Operations/CancelOperation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OperationsServer).CancelOperation(ctx, req.(*CancelOperationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Operations_serviceDesc = grpc.ServiceDesc{ - ServiceName: "google.longrunning.Operations", - HandlerType: (*OperationsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListOperations", - Handler: _Operations_ListOperations_Handler, - }, - { - MethodName: "GetOperation", - Handler: _Operations_GetOperation_Handler, - }, - { - MethodName: "DeleteOperation", - Handler: _Operations_DeleteOperation_Handler, - }, - { - MethodName: "CancelOperation", - Handler: _Operations_CancelOperation_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "google/longrunning/operations.proto", -} - -func init() { proto.RegisterFile("google/longrunning/operations.proto", fileDescriptor0) } - -var fileDescriptor0 = []byte{ - // 586 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0xad, 0xd3, 0x24, 0x4a, 0xa6, 0x40, 0xa4, 0x85, 0xba, 0xc6, 0x25, 0x22, 0x32, 0x08, 0x52, - 0xab, 0xb2, 0x21, 0xdc, 0x8a, 0x72, 0x20, 0x80, 0xda, 0x43, 0x25, 0x22, 0x97, 0x13, 0x97, 0x6a, - 0x9b, 0x4e, 0x2d, 0x0b, 0x67, 0xd7, 0xac, 0x37, 0xd0, 0x16, 0x55, 0x11, 0x1c, 0x38, 0x71, 0xe3, - 0x2f, 0xf8, 0x19, 0x0e, 0xfc, 0x02, 0x1f, 0x82, 0xbc, 0x76, 0x62, 0x93, 0x3a, 0x28, 0xb7, 0xf5, - 0xcc, 0x9b, 0x79, 0xf3, 0xde, 0xce, 0x1a, 0x1e, 0xf8, 0x9c, 0xfb, 0x21, 0xba, 0x21, 0x67, 0xbe, - 0x98, 0x30, 0x16, 0x30, 0xdf, 0xe5, 0x11, 0x0a, 0x2a, 0x03, 0xce, 0x62, 0x27, 0x12, 0x5c, 0x72, - 0x42, 0x52, 0x90, 0x53, 0x00, 0x99, 0xf7, 0xb2, 0x42, 0x1a, 0x05, 0x2e, 0x65, 0x8c, 0xcb, 0x62, - 0x85, 0x79, 0x37, 0xcb, 0xaa, 0xaf, 0x93, 0xc9, 0x99, 0x4b, 0xd9, 0x45, 0x96, 0xda, 0x5e, 0x4c, - 0xe1, 0x38, 0x92, 0xb3, 0xe4, 0x56, 0x96, 0x14, 0xd1, 0xc8, 0x8d, 0x25, 0x95, 0x93, 0xac, 0xa1, - 0xf5, 0x4b, 0x83, 0xe6, 0x9b, 0xd9, 0x5c, 0x84, 0x40, 0x95, 0xd1, 0x31, 0x1a, 0x5a, 0x47, 0xeb, - 0x36, 0x3d, 0x75, 0x26, 0x4f, 0xa0, 0x31, 0x46, 0x49, 0x4f, 0xa9, 0xa4, 0x46, 0xa5, 0xa3, 0x75, - 0x37, 0x7a, 0x77, 0x9c, 0x6c, 0xee, 0x19, 0x95, 0xf3, 0x82, 0x5d, 0x78, 0x73, 0x54, 0xd2, 0xe5, - 0x94, 0x33, 0x34, 0xd6, 0x3b, 0x5a, 0xb7, 0xe1, 0xa9, 0x33, 0xb1, 0xa1, 0x86, 0x42, 0x70, 0x61, - 0x54, 0x55, 0x0b, 0x32, 0x6b, 0x21, 0xa2, 0x91, 0x73, 0xa4, 0x06, 0x3a, 0x58, 0xf3, 0x52, 0x08, - 0xe9, 0x41, 0x43, 0x60, 0x1c, 0x71, 0x16, 0xa3, 0x51, 0x5b, 0xce, 0x78, 0xb0, 0xe6, 0xcd, 0x71, - 0x83, 0x06, 0xd4, 0x05, 0xc6, 0x93, 0x50, 0x5a, 0x3b, 0x70, 0x7b, 0x1f, 0xe5, 0x5c, 0x93, 0x87, - 0x1f, 0x26, 0x18, 0xcb, 0x32, 0x69, 0xd6, 0x14, 0x36, 0x0f, 0x83, 0x38, 0xc7, 0xc6, 0x8b, 0xe0, - 0x6a, 0xc1, 0x07, 0x1d, 0xea, 0x67, 0x41, 0x28, 0x51, 0x64, 0x2d, 0xb2, 0x2f, 0xb2, 0x0d, 0xcd, - 0x88, 0xfa, 0x78, 0x1c, 0x07, 0x97, 0xa8, 0x0c, 0xaa, 0x79, 0x8d, 0x24, 0x70, 0x14, 0x5c, 0x22, - 0x69, 0x03, 0xa8, 0xa4, 0xe4, 0xef, 0x91, 0x29, 0x43, 0x9a, 0x9e, 0x82, 0xbf, 0x4d, 0x02, 0xd6, - 0x14, 0xf4, 0xc5, 0x01, 0x52, 0x3d, 0xa4, 0x0f, 0x90, 0xaf, 0x8b, 0xa1, 0x75, 0xd6, 0xbb, 0x1b, - 0xbd, 0xb6, 0x73, 0x7d, 0x5f, 0x9c, 0x5c, 0x68, 0xa1, 0x80, 0x3c, 0x82, 0x16, 0xc3, 0x73, 0x79, - 0x5c, 0x20, 0xaf, 0x28, 0xf2, 0x9b, 0x49, 0x78, 0x38, 0x1f, 0x60, 0x17, 0xf4, 0x97, 0x94, 0x8d, - 0x30, 0x5c, 0xc9, 0xaf, 0x5d, 0xd0, 0x5f, 0x61, 0x88, 0x12, 0x57, 0x41, 0xf7, 0xbe, 0x57, 0x01, - 0x72, 0x65, 0xe4, 0x9b, 0x06, 0xb7, 0xfe, 0x15, 0x4b, 0x76, 0xca, 0x04, 0x95, 0xde, 0x88, 0x69, - 0xaf, 0x02, 0x4d, 0xbd, 0xb3, 0xda, 0x5f, 0x7f, 0xff, 0xf9, 0x51, 0xd9, 0x22, 0x9b, 0xee, 0xc7, - 0xa7, 0xee, 0xe7, 0x64, 0x96, 0x7e, 0x6e, 0xcd, 0x15, 0x39, 0x87, 0x1b, 0xc5, 0x05, 0x21, 0x8f, - 0xcb, 0x5a, 0x97, 0xac, 0x90, 0xf9, 0x7f, 0xff, 0xad, 0x8e, 0xa2, 0x35, 0x89, 0x51, 0x46, 0xeb, - 0xda, 0xf6, 0x15, 0xf9, 0x04, 0xad, 0x05, 0xff, 0x48, 0xa9,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