diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 85f22b5..57fde4f 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -8,11 +8,6 @@ import ( "time" "github.com/sirupsen/logrus" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" - "google.golang.org/grpc/credentials" - "google.golang.org/grpc/credentials/insecure" - "google.golang.org/grpc/encoding/gzip" "cloud-proxy/internal/cloud/gcp" "cloud-proxy/internal/cloud/gcp/gcpauth" @@ -39,53 +34,8 @@ func main() { logger.WithError(err).Panicf("Failed to create GCP credentials source") } - dialOpts := make([]grpc.DialOption, 0) - if cfg.CastAI.DisableGRPCTLS { - // ONLY For testing purposes. - dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) - } else { - dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(nil))) - } - - connectParams := grpc.ConnectParams{ - Backoff: backoff.Config{ - BaseDelay: 2 * time.Second, - Jitter: 0.1, - MaxDelay: 5 * time.Second, - Multiplier: 1.2, - }, - } - dialOpts = append(dialOpts, grpc.WithConnectParams(connectParams)) - - if cfg.UseCompression { - dialOpts = append(dialOpts, grpc.WithDefaultCallOptions( - grpc.UseCompressor(gzip.Name), - )) - } - - logger.Infof( - "Creating grpc channel against (%s) with connection config (%+v) and TLS enabled=%v", - cfg.CastAI.GrpcURL, - connectParams, - !cfg.CastAI.DisableGRPCTLS, - ) - conn, err := grpc.NewClient(cfg.CastAI.GrpcURL, dialOpts...) - if err != nil { - logger.Panicf("Failed to connect to server: %v", err) - panic(err) - } - - defer func(conn *grpc.ClientConn) { - logger.Info("Closing grpc connection") - err := conn.Close() - if err != nil { - logger.Panicf("Failed to close gRPC connection: %v", err) - panic(err) - } - }(conn) - - client := proxy.New(conn, gcp.New(tokenSource), logger, - cfg.GetPodName(), cfg.ClusterID, GetVersion(), cfg.CastAI.APIKey, cfg.KeepAlive, cfg.KeepAliveTimeout) + client := proxy.New(gcp.New(tokenSource), logger, + GetVersion(), &cfg) go startHealthServer(logger, cfg.HealthAddress) diff --git a/internal/e2etest/roundtripper.go b/internal/e2etest/roundtripper.go index 40d2736..6b61a70 100644 --- a/internal/e2etest/roundtripper.go +++ b/internal/e2etest/roundtripper.go @@ -32,20 +32,22 @@ func (p *HTTPOverGrpcRoundTripper) RoundTrip(request *http.Request) (*http.Respo protoReq := &cloudproxyv1alpha.StreamCloudProxyResponse{ MessageId: requestID, - HttpRequest: &cloudproxyv1alpha.HTTPRequest{ - Method: request.Method, - Path: request.URL.String(), - Headers: headers, - Body: func() []byte { - if request.Body == nil { - return []byte{} - } - body, err := io.ReadAll(request.Body) - if err != nil { - panic(fmt.Sprintf("Failed to read body: %v", err)) - } - return body - }(), + Response: &cloudproxyv1alpha.StreamCloudProxyResponse_HttpRequest{ + HttpRequest: &cloudproxyv1alpha.HTTPRequest{ + Method: request.Method, + Path: request.URL.String(), + Headers: headers, + Body: func() []byte { + if request.Body == nil { + return []byte{} + } + body, err := io.ReadAll(request.Body) + if err != nil { + panic(fmt.Sprintf("Failed to read body: %v", err)) + } + return body + }(), + }, }, } waiter, err := p.dispatcher.SendRequest(protoReq) diff --git a/internal/proxy/client.go b/internal/proxy/client.go index 35439b1..f3dce8e 100644 --- a/internal/proxy/client.go +++ b/internal/proxy/client.go @@ -14,9 +14,15 @@ import ( "github.com/samber/lo" "github.com/sirupsen/logrus" + "golang.org/x/sync/errgroup" "google.golang.org/grpc" + "google.golang.org/grpc/backoff" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/encoding/gzip" "google.golang.org/grpc/metadata" + "cloud-proxy/internal/config" cloudproxyv1alpha "cloud-proxy/proto/gen/proto/v1alpha" ) @@ -33,8 +39,10 @@ type CloudClient interface { } type Client struct { - grpcConn *grpc.ClientConn - apiKey string + cfg *config.Config + + sendCh chan *cloudproxyv1alpha.StreamCloudProxyRequest + cloudClient CloudClient log *logrus.Logger podName string @@ -43,32 +51,36 @@ type Client struct { errCount atomic.Int64 processedCount atomic.Int64 - lastSeen atomic.Int64 - lastSeenError atomic.Pointer[error] + lastSeenReceive atomic.Int64 + lastSeenSend atomic.Int64 + keepAlive atomic.Int64 keepAliveTimeout atomic.Int64 - version string + + version string } -func New(grpcConn *grpc.ClientConn, cloudClient CloudClient, logger *logrus.Logger, podName, clusterID, version, apiKey string, keepalive, keepaliveTimeout time.Duration) *Client { +func New(cloudClient CloudClient, logger *logrus.Logger, version string, cfg *config.Config) *Client { c := &Client{ - grpcConn: grpcConn, - apiKey: apiKey, + cfg: cfg, + sendCh: make(chan *cloudproxyv1alpha.StreamCloudProxyRequest, 100), cloudClient: cloudClient, log: logger, - podName: podName, - clusterID: clusterID, + podName: cfg.PodMetadata.PodName, + clusterID: cfg.ClusterID, version: version, } - c.keepAlive.Store(int64(keepalive)) - c.keepAliveTimeout.Store(int64(keepaliveTimeout)) + c.keepAlive.Store(int64(cfg.KeepAlive)) + c.keepAliveTimeout.Store(int64(cfg.KeepAliveTimeout)) return c } func (c *Client) Run(ctx context.Context) error { + defer close(c.sendCh) + streamCtx := metadata.NewOutgoingContext(ctx, metadata.Pairs( - authorizationMetadataKey, fmt.Sprintf("Token %s", c.apiKey), + authorizationMetadataKey, fmt.Sprintf("Token %s", c.cfg.CastAI.APIKey), clusterIDMetadataKey, c.clusterID, podNameMetadataKey, c.podName, )) @@ -81,14 +93,7 @@ func (c *Client) Run(ctx context.Context) error { return streamCtx.Err() case <-t.C: c.log.Info("Starting proxy client") - stream, closeStream, err := c.getStream(streamCtx) - if err != nil { - c.log.Errorf("Could not get stream, restarting proxy client in %vs: %v", time.Duration(c.keepAlive.Load()).Seconds(), err) - t.Reset(time.Duration(c.keepAlive.Load())) - continue - } - - err = c.run(streamCtx, stream, closeStream) + err := c.prepareAndRun(streamCtx) if err != nil { c.log.Errorf("Restarting proxy client in %vs: due to error: %v", time.Duration(c.keepAlive.Load()).Seconds(), err) t.Reset(time.Duration(c.keepAlive.Load())) @@ -99,136 +104,195 @@ func (c *Client) Run(ctx context.Context) error { func (c *Client) getStream(ctx context.Context) (cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient, func(), error) { c.log.Info("Connecting to castai") - apiClient := cloudproxyv1alpha.NewCloudProxyAPIClient(c.grpcConn) - stream, err := apiClient.StreamCloudProxy(ctx) + dialOpts := make([]grpc.DialOption, 0) + if c.cfg.CastAI.DisableGRPCTLS { + // ONLY For testing purposes. + dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials())) + } else { + dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(nil))) + } + + connectParams := grpc.ConnectParams{ + Backoff: backoff.Config{ + BaseDelay: 2 * time.Second, + Jitter: 0.1, + MaxDelay: 5 * time.Second, + Multiplier: 1.2, + }, + MinConnectTimeout: 2 * time.Minute, + } + dialOpts = append(dialOpts, grpc.WithConnectParams(connectParams)) + + if c.cfg.UseCompression { + dialOpts = append(dialOpts, grpc.WithDefaultCallOptions( + grpc.UseCompressor(gzip.Name), + )) + } + + c.log.Infof( + "Creating grpc channel against (%s) with connection config (%+v) and TLS enabled=%v", + c.cfg.CastAI.GrpcURL, + connectParams, + !c.cfg.CastAI.DisableGRPCTLS, + ) + + conn, err := grpc.NewClient(c.cfg.CastAI.GrpcURL, dialOpts...) if err != nil { - return nil, nil, fmt.Errorf("proxyCastAIClient.StreamCloudProxy: %w", err) + return nil, nil, fmt.Errorf("grpc.NewClient: %w", err) } - c.log.Info("Connected to castai, sending initial metadata") - return stream, func() { - err := stream.CloseSend() + cancelFunc := func() { + c.log.Info("Closing grpc connection") + err := conn.Close() if err != nil { - c.log.Errorf("error closing stream %v", err) + c.log.Errorf("error closing grpc connection %v", err) } - }, nil -} - -func (c *Client) sendInitialRequest(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { - c.log.Info("Sending initial request to castai") + } - err := stream.Send(&cloudproxyv1alpha.StreamCloudProxyRequest{ - Request: &cloudproxyv1alpha.StreamCloudProxyRequest_InitialRequest{ - InitialRequest: &cloudproxyv1alpha.InitialCloudProxyRequest{ - ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ - PodName: c.podName, - ClusterId: c.clusterID, - }, - Version: c.version, - }, - }, - }) + apiClient := cloudproxyv1alpha.NewCloudProxyAPIClient(conn) + stream, err := apiClient.StreamCloudProxy(ctx) if err != nil { - return fmt.Errorf("stream.Send: initial request %w", err) + return nil, cancelFunc, fmt.Errorf("proxyCastAIClient.StreamCloudProxy: %w", err) } - c.lastSeen.Store(time.Now().UnixNano()) - c.lastSeenError.Store(nil) - c.log.Info("Stream to castai started successfully") - - return nil + c.log.Info("Connected to castai, sending initial metadata") + return stream, cancelFunc, nil } -func (c *Client) run(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient, closeStream func()) error { - defer closeStream() +func (c *Client) prepareAndRun(ctx context.Context) error { + ctx, cancel := context.WithCancel(ctx) + defer cancel() - err := c.sendInitialRequest(stream) + stream, closeConnection, err := c.getStream(ctx) if err != nil { - return fmt.Errorf("c.Connect: %w", err) + return fmt.Errorf("c.getStream: %w", err) } + defer closeConnection() - keepAliveCh := make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) - defer close(keepAliveCh) - go c.sendKeepAlive(stream, keepAliveCh) + c.lastSeenReceive.Store(time.Now().UnixNano()) + c.lastSeenSend.Store(time.Now().UnixNano()) - messageRespCh := make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) - defer close(messageRespCh) + return c.sendAndReceive(ctx, stream) +} - go func() { - for { - select { - case <-ctx.Done(): - return - case <-stream.Context().Done(): - return - default: - if !c.isAlive() { - return - } - } +func (c *Client) sendAndReceive(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { + eg, egCtx := errgroup.WithContext(ctx) - c.log.Debugf("Polling stream for messages") + eg.Go(func() error { + err := c.sendKeepAlive(egCtx, stream) + if err != nil { + c.log.Errorf("stopping keep-alive loop: %v", err) + } + return err + }) - in, err := stream.Recv() - if err != nil { - c.log.Errorf("stream.Recv: got error: %v", err) - c.lastSeen.Store(0) - c.lastSeenError.Store(&err) - return - } + eg.Go(func() error { + err := c.receive(egCtx, stream) + if err != nil { + c.log.Errorf("stopping receive loop: %v", err) + } + return err + }) - c.log.Debugf("Handling message from castai") - go c.handleMessage(in, messageRespCh) + // send loop is separate because it can block on sending messages. + go func() { + err := c.send(egCtx, stream) + if err != nil { + c.log.Errorf("stopped send loop: %v", err) } }() + err := eg.Wait() + if err != nil { + c.log.Errorf("sendAndReceive: closing with error: %v", err) + } + + return err +} + +func (c *Client) send(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { + defer func() { + c.log.Info("Closing send channel") + _ = stream.CloseSend() + }() + for { select { case <-ctx.Done(): return ctx.Err() case <-stream.Context().Done(): return fmt.Errorf("stream closed %w", stream.Context().Err()) - case req := <-keepAliveCh: + case req := <-c.sendCh: + c.log.Printf("Sending message to stream %v len=%v", req.GetResponse().GetMessageId(), len(req.GetResponse().GetHttpResponse().GetBody())) if err := stream.Send(req); err != nil { - c.log.WithError(err).Warn("failed to send keep alive") - } - case req := <-messageRespCh: - if err := stream.Send(req); err != nil { - c.log.WithError(err).Warn("failed to send message response") + c.log.WithError(err).Warn("failed to send message to stream") + return fmt.Errorf("failed to send message to stream: %w", err) } + c.lastSeenSend.Store(time.Now().UnixNano()) + case <-time.After(time.Duration(c.keepAlive.Load())): - if !c.isAlive() { - if err := c.lastSeenError.Load(); err != nil { - return fmt.Errorf("received error: %w", *err) - } - return fmt.Errorf("last seen too old, closing stream") + if err := c.isAlive(); err != nil { + return err + } + } + } +} + +func (c *Client) receive(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { + for { + select { + case <-ctx.Done(): + return fmt.Errorf("context ended with %w", ctx.Err()) + case <-stream.Context().Done(): + return fmt.Errorf("stream ended with %w", stream.Context().Err()) + default: + if err := c.isAlive(); err != nil { + return err } } + + c.log.Debugf("Polling stream for messages") + + in, err := stream.Recv() + if err != nil { + c.log.Errorf("stream.Recv: got error: %v", err) + c.lastSeenReceive.Store(0) + return fmt.Errorf("stream.Recv: %w", err) + } + + c.lastSeenReceive.Store(time.Now().UnixNano()) + c.log.Debugf("Handling message from castai") + go c.handleMessage(ctx, in) } } -func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, respCh chan<- *cloudproxyv1alpha.StreamCloudProxyRequest) { +func (c *Client) handleMessage(ctx context.Context, in *cloudproxyv1alpha.StreamCloudProxyResponse) { if in == nil { c.log.Error("nil message") return } + c.processConfigurationRequest(in) // skip processing http request if keep alive message. if in.GetMessageId() == KeepAliveMessageID { - c.lastSeen.Store(time.Now().UnixNano()) - c.log.Debugf("Received keep-alive message from castai for %s", in.GetClientMetadata().GetClusterId()) + c.log.Debugf("Received keep-alive message from castai for %s", in.GetClientMetadata().GetPodName()) return } - c.log.Debugf("Received request for proxying msg_id=%v from castai", in.GetMessageId()) + c.log.Debugf("Received request for proxying msg_id=%v path=%v from castai", in.GetMessageId(), in.GetHttpRequest().GetPath()) resp := c.processHTTPRequest(in.GetHttpRequest()) if resp.GetError() != "" { c.log.Errorf("Failed to proxy request msg_id=%v with %v", in.GetMessageId(), resp.GetError()) } else { c.log.Debugf("Proxied request msg_id=%v, sending response to castai", in.GetMessageId()) } - respCh <- &cloudproxyv1alpha.StreamCloudProxyRequest{ + + select { + case <-ctx.Done(): + return + + case c.sendCh <- &cloudproxyv1alpha.StreamCloudProxyRequest{ Request: &cloudproxyv1alpha.StreamCloudProxyRequest_Response{ Response: &cloudproxyv1alpha.ClusterResponse{ ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ @@ -239,19 +303,24 @@ func (c *Client) handleMessage(in *cloudproxyv1alpha.StreamCloudProxyResponse, r HttpResponse: resp, }, }, + }: + return } } func (c *Client) processConfigurationRequest(in *cloudproxyv1alpha.StreamCloudProxyResponse) { - if in.ConfigurationRequest != nil { - if in.ConfigurationRequest.GetKeepAlive() != 0 { - c.keepAlive.Store(in.ConfigurationRequest.GetKeepAlive()) - } - if in.ConfigurationRequest.GetKeepAliveTimeout() != 0 { - c.keepAliveTimeout.Store(in.ConfigurationRequest.GetKeepAliveTimeout()) - } + if in.GetConfigurationRequest() == nil { + return + } + + if in.GetConfigurationRequest().GetKeepAlive() != 0 { + c.keepAlive.Store(in.GetConfigurationRequest().GetKeepAlive()) + } + if in.GetConfigurationRequest().GetKeepAliveTimeout() != 0 { + c.keepAliveTimeout.Store(in.GetConfigurationRequest().GetKeepAliveTimeout()) } - c.log.Debugf("Updated keep-alive configuration to %v and keep-alive timeout to %v", c.keepAlive.Load(), c.keepAliveTimeout.Load()) + + c.log.Debugf("Updated keep-alive configuration to %v and keep-alive timeout to %v", time.Duration(c.keepAlive.Load()).Seconds(), time.Duration(c.keepAliveTimeout.Load()).Seconds()) } func (c *Client) processHTTPRequest(req *cloudproxyv1alpha.HTTPRequest) *cloudproxyv1alpha.HTTPResponse { @@ -278,45 +347,64 @@ func (c *Client) processHTTPRequest(req *cloudproxyv1alpha.HTTPRequest) *cloudpr return c.toResponse(resp) } -func (c *Client) isAlive() bool { - lastSeen := c.lastSeen.Load() +var errAlive = fmt.Errorf("client connection is not alive") - return time.Now().UnixNano()-lastSeen <= c.keepAliveTimeout.Load() +func (c *Client) isAlive() error { + lastSeenReceive := c.lastSeenReceive.Load() + lastSeenSend := c.lastSeenSend.Load() + keepAliveTimeout := c.keepAliveTimeout.Load() + lastSeenReceiveDiff := time.Now().UnixNano() - lastSeenReceive + lastSeenSendDiff := time.Now().UnixNano() - lastSeenSend + + if lastSeenReceiveDiff > keepAliveTimeout || lastSeenSendDiff > keepAliveTimeout { + c.log.Warnf("last seen receive %v, last seen send %v %v", + time.Duration(lastSeenReceiveDiff).Seconds(), time.Duration(lastSeenSendDiff).Seconds(), errAlive) + return errAlive + } + + return nil } -func (c *Client) sendKeepAlive(stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient, sendCh chan<- *cloudproxyv1alpha.StreamCloudProxyRequest) { +func (c *Client) sendKeepAlive(ctx context.Context, stream cloudproxyv1alpha.CloudProxyAPI_StreamCloudProxyClient) error { ticker := time.NewTimer(time.Duration(c.keepAlive.Load())) defer ticker.Stop() c.log.Info("Starting keep-alive loop") + for { select { - case <-stream.Context().Done(): - c.log.Infof("Stopping keep-alive loop: stream ended with %v", stream.Context().Err()) - return + case <-ctx.Done(): + return fmt.Errorf("context ended with %w", ctx.Err()) case <-ticker.C: - if !c.isAlive() { - c.log.Info("Stopping keep-alive loop: client connection is not alive") - return - } - c.log.Debug("Sending keep-alive to castai") - - sendCh <- &cloudproxyv1alpha.StreamCloudProxyRequest{ - Request: &cloudproxyv1alpha.StreamCloudProxyRequest_ClientStats{ - ClientStats: &cloudproxyv1alpha.ClientStats{ - ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ - PodName: c.podName, - ClusterId: c.clusterID, - }, - Stats: &cloudproxyv1alpha.ClientStats_Stats{ - Status: cloudproxyv1alpha.ClientStats_Stats_OK, - Timestamp: time.Now().UnixNano(), + if time.Now().UnixNano()-c.lastSeenSend.Load() <= c.keepAlive.Load()/2 { + ticker.Reset(time.Duration(c.keepAlive.Load())) + } else { + select { + case c.sendCh <- &cloudproxyv1alpha.StreamCloudProxyRequest{ + Request: &cloudproxyv1alpha.StreamCloudProxyRequest_ClientStats{ + ClientStats: &cloudproxyv1alpha.ClientStats{ + ClientMetadata: &cloudproxyv1alpha.ClientMetadata{ + PodName: c.podName, + ClusterId: c.clusterID, + Version: c.version, + }, + Stats: &cloudproxyv1alpha.ClientStats_Stats{ + Timestamp: time.Now().UnixNano(), + }, }, }, - }, + }: + ticker.Reset(time.Duration(c.keepAlive.Load())) + + default: + if stream.Context().Err() != nil { + return fmt.Errorf("stream ended with %w", stream.Context().Err()) + } + if err := c.isAlive(); err != nil { + return err + } + } } - - ticker.Reset(time.Duration(c.keepAlive.Load())) } } } diff --git a/internal/proxy/client_test.go b/internal/proxy/client_test.go index cb5297c..0a91cc3 100644 --- a/internal/proxy/client_test.go +++ b/internal/proxy/client_test.go @@ -83,7 +83,14 @@ func TestClient_toResponse(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, nil, "podName", "clusterID", "version", "apiKey", time.Second, time.Minute) + c := New(nil, logrus.New(), "version", &config.Config{ + ClusterID: "clusterID", + PodMetadata: config.PodMetadata{ + PodName: "podName", + }, + KeepAlive: time.Second, + KeepAliveTimeout: time.Minute, + }) got := c.toResponse(tt.args.resp) // diff := cmp.Diff(got, tt.want, protocmp.Transform()) // require.Empty(t, diff). @@ -146,7 +153,14 @@ func TestClient_toHTTPRequest(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() - c := New(nil, nil, nil, "podName", "clusterID", "version", "apiKey", time.Second, time.Minute) + c := New(nil, logrus.New(), "version", &config.Config{ + ClusterID: "clusterID", + PodMetadata: config.PodMetadata{ + PodName: "podName", + }, + KeepAlive: time.Second, + KeepAliveTimeout: time.Minute, + }) got, err := c.toHTTPRequest(tt.args.req) require.Equal(t, tt.wantErr, err != nil, err) if err != nil { @@ -173,14 +187,12 @@ func TestClient_handleMessage(t *testing.T) { name string fields fields args args - wantLastSeenUpdated bool wantKeepAlive int64 wantKeepAliveTimeout int64 wantErrCount int64 }{ { name: "nil response", - wantLastSeenUpdated: false, wantKeepAlive: int64(config.KeepAliveDefault), wantKeepAliveTimeout: int64(config.KeepAliveTimeoutDefault), }, @@ -191,7 +203,6 @@ func TestClient_handleMessage(t *testing.T) { MessageId: KeepAliveMessageID, }, }, - wantLastSeenUpdated: true, wantKeepAlive: int64(config.KeepAliveDefault), wantKeepAliveTimeout: int64(config.KeepAliveTimeoutDefault), }, @@ -200,13 +211,14 @@ func TestClient_handleMessage(t *testing.T) { args: args{ in: &cloudproxyv1alpha.StreamCloudProxyResponse{ MessageId: KeepAliveMessageID, - ConfigurationRequest: &cloudproxyv1alpha.ConfigurationRequest{ - KeepAlive: 1, - KeepAliveTimeout: 2, + Response: &cloudproxyv1alpha.StreamCloudProxyResponse_ConfigurationRequest{ + ConfigurationRequest: &cloudproxyv1alpha.ConfigurationRequest{ + KeepAlive: 1, + KeepAliveTimeout: 2, + }, }, }, }, - wantLastSeenUpdated: true, wantKeepAlive: 1, wantKeepAliveTimeout: 2, }, @@ -255,19 +267,20 @@ func TestClient_handleMessage(t *testing.T) { if tt.fields.tuneMockCloudClient != nil { tt.fields.tuneMockCloudClient(cloudClient) } - c := New(nil, cloudClient, logrus.New(), "podName", "clusterID", "version", "apiKey", config.KeepAliveDefault, config.KeepAliveTimeoutDefault) + c := New(cloudClient, logrus.New(), "version", &config.Config{ + ClusterID: "clusterID", + PodMetadata: config.PodMetadata{ + PodName: "podName", + }, + KeepAlive: config.KeepAliveDefault, + KeepAliveTimeout: config.KeepAliveTimeoutDefault, + }) stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) if tt.args.tuneMockStream != nil { tt.args.tuneMockStream(stream) } - msgStream := make(chan *cloudproxyv1alpha.StreamCloudProxyRequest) - go func() { - <-msgStream - }() - - c.handleMessage(tt.args.in, msgStream) - require.Equal(t, tt.wantLastSeenUpdated, c.lastSeen.Load() > 0, "lastSeen: %v", c.lastSeen.Load()) + c.handleMessage(context.Background(), tt.args.in) require.Equal(t, tt.wantKeepAlive, c.keepAlive.Load(), "keepAlive: %v", c.keepAlive.Load()) require.Equal(t, tt.wantKeepAliveTimeout, c.keepAliveTimeout.Load(), "keepAliveTimeout: %v", c.keepAliveTimeout.Load()) require.Equal(t, tt.wantErrCount, c.errCount.Load(), "errCount: %v", c.errCount.Load()) @@ -345,7 +358,14 @@ func TestClient_processHttpRequest(t *testing.T) { if tt.fields.tuneMockCloudClient != nil { tt.fields.tuneMockCloudClient(cloudClient) } - c := New(nil, cloudClient, logrus.New(), "podName", "clusterID", "version", "apiKey", time.Second, time.Minute) + c := New(cloudClient, logrus.New(), "version", &config.Config{ + ClusterID: "clusterID", + PodMetadata: config.PodMetadata{ + PodName: "podName", + }, + KeepAlive: time.Second, + KeepAliveTimeout: time.Minute, + }) if got := c.processHTTPRequest(tt.args.req); !reflect.DeepEqual(got, tt.want) { t.Errorf("processHttpRequest() = %v, want %v", got, tt.want) } @@ -422,7 +442,7 @@ func TestClient_processHttpRequest(t *testing.T) { // } //}. -func TestClient_run(t *testing.T) { +func TestClient_sendAndReceive(t *testing.T) { t.Parallel() type args struct { @@ -430,10 +450,9 @@ func TestClient_run(t *testing.T) { tuneMockStream func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) } tests := []struct { - name string - args args - wantErr bool - wantLastSeenUpdated bool + name string + args args + wantErr bool }{ { name: "send initial error", @@ -443,6 +462,12 @@ func TestClient_run(t *testing.T) { }, tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { m.EXPECT().Send(gomock.Any()).Return(fmt.Errorf("test error")) + m.EXPECT().Recv().DoAndReturn(func() (*cloudproxyv1alpha.StreamCloudProxyResponse, error) { + time.Sleep(time.Millisecond) + return &cloudproxyv1alpha.StreamCloudProxyResponse{}, nil + }).AnyTimes() + m.EXPECT().Context().Return(context.Background()).AnyTimes() + m.EXPECT().CloseSend().Return(nil) }, }, wantErr: true, @@ -456,15 +481,19 @@ func TestClient_run(t *testing.T) { return ctx }, tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { - m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times. - m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times. + m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times. + m.EXPECT().Context().DoAndReturn(func() context.Context { + ctx, cancel := context.WithCancel(context.Background()) + cancel() + return ctx + }).AnyTimes() // expected 0 or 1 times. + m.EXPECT().CloseSend().Return(nil) }, }, - wantLastSeenUpdated: true, - wantErr: true, + wantErr: true, }, { - name: "stream not alive", + name: "receive not alive", args: args{ ctx: func() context.Context { return context.Background() @@ -472,11 +501,11 @@ func TestClient_run(t *testing.T) { tuneMockStream: func(m *mock_proxy.MockCloudProxyAPI_StreamCloudProxyClient) { m.EXPECT().Send(gomock.Any()).Return(nil).AnyTimes() // expected 0 or 1 times. m.EXPECT().Context().Return(context.Background()).AnyTimes() // expected 0 or 1 times. - m.EXPECT().Recv().Return(nil, fmt.Errorf("test error")) + m.EXPECT().Recv().Return(nil, fmt.Errorf("test error")).AnyTimes() + m.EXPECT().CloseSend().Return(nil).AnyTimes() }, }, - wantLastSeenUpdated: false, - wantErr: true, + wantErr: true, }, } for _, tt := range tests { @@ -486,16 +515,24 @@ func TestClient_run(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - c := New(nil, nil, logrus.New(), "podName", "clusterID", "version", "apiKey", time.Second, time.Second) + c := New(nil, logrus.New(), "version", &config.Config{ + ClusterID: "clusterID", + PodMetadata: config.PodMetadata{ + PodName: "podName", + }, + KeepAlive: time.Second, + KeepAliveTimeout: time.Second * 2, + }) + c.lastSeenReceive.Store(time.Now().UnixNano()) + c.lastSeenSend.Store(time.Now().UnixNano()) stream := mock_proxy.NewMockCloudProxyAPI_StreamCloudProxyClient(ctrl) if tt.args.tuneMockStream != nil { tt.args.tuneMockStream(stream) } - if err := c.run(tt.args.ctx(), stream, func() {}); (err != nil) != tt.wantErr { + + if err := c.sendAndReceive(tt.args.ctx(), stream); (err != nil) != tt.wantErr { t.Errorf("run() error = %v, wantErr %v", err, tt.wantErr) } - - require.Equal(t, tt.wantLastSeenUpdated, c.lastSeen.Load() > 0, "lastSeen: %v", c.lastSeen.Load()) }) } } diff --git a/proto/gen/proto/v1alpha/proxy.pb.go b/proto/gen/proto/v1alpha/proxy.pb.go index 1f09b50..7c40c9f 100644 --- a/proto/gen/proto/v1alpha/proxy.pb.go +++ b/proto/gen/proto/v1alpha/proxy.pb.go @@ -20,56 +20,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// Status of the cluster client. -type ClientStats_Stats_Status int32 - -const ( - ClientStats_Stats_UNKNOWN ClientStats_Stats_Status = 0 - ClientStats_Stats_OK ClientStats_Stats_Status = 1 - ClientStats_Stats_CLOSING ClientStats_Stats_Status = 2 -) - -// Enum value maps for ClientStats_Stats_Status. -var ( - ClientStats_Stats_Status_name = map[int32]string{ - 0: "UNKNOWN", - 1: "OK", - 2: "CLOSING", - } - ClientStats_Stats_Status_value = map[string]int32{ - "UNKNOWN": 0, - "OK": 1, - "CLOSING": 2, - } -) - -func (x ClientStats_Stats_Status) Enum() *ClientStats_Stats_Status { - p := new(ClientStats_Stats_Status) - *p = x - return p -} - -func (x ClientStats_Stats_Status) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ClientStats_Stats_Status) Descriptor() protoreflect.EnumDescriptor { - return file_proto_v1alpha_proxy_proto_enumTypes[0].Descriptor() -} - -func (ClientStats_Stats_Status) Type() protoreflect.EnumType { - return &file_proto_v1alpha_proxy_proto_enumTypes[0] -} - -func (x ClientStats_Stats_Status) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ClientStats_Stats_Status.Descriptor instead. -func (ClientStats_Stats_Status) EnumDescriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2, 0, 0} -} - type StreamCloudProxyRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -77,7 +27,6 @@ type StreamCloudProxyRequest struct { // Types that are assignable to Request: // - // *StreamCloudProxyRequest_InitialRequest // *StreamCloudProxyRequest_ClientStats // *StreamCloudProxyRequest_Response Request isStreamCloudProxyRequest_Request `protobuf_oneof:"request"` @@ -122,13 +71,6 @@ func (m *StreamCloudProxyRequest) GetRequest() isStreamCloudProxyRequest_Request return nil } -func (x *StreamCloudProxyRequest) GetInitialRequest() *InitialCloudProxyRequest { - if x, ok := x.GetRequest().(*StreamCloudProxyRequest_InitialRequest); ok { - return x.InitialRequest - } - return nil -} - func (x *StreamCloudProxyRequest) GetClientStats() *ClientStats { if x, ok := x.GetRequest().(*StreamCloudProxyRequest_ClientStats); ok { return x.ClientStats @@ -147,11 +89,6 @@ type isStreamCloudProxyRequest_Request interface { isStreamCloudProxyRequest_Request() } -type StreamCloudProxyRequest_InitialRequest struct { - // Initial request to establish the connection. - InitialRequest *InitialCloudProxyRequest `protobuf:"bytes,1,opt,name=initial_request,json=initialRequest,proto3,oneof"` -} - type StreamCloudProxyRequest_ClientStats struct { ClientStats *ClientStats `protobuf:"bytes,2,opt,name=client_stats,json=clientStats,proto3,oneof"` } @@ -160,67 +97,10 @@ type StreamCloudProxyRequest_Response struct { Response *ClusterResponse `protobuf:"bytes,3,opt,name=response,proto3,oneof"` } -func (*StreamCloudProxyRequest_InitialRequest) isStreamCloudProxyRequest_Request() {} - func (*StreamCloudProxyRequest_ClientStats) isStreamCloudProxyRequest_Request() {} func (*StreamCloudProxyRequest_Response) isStreamCloudProxyRequest_Request() {} -type InitialCloudProxyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ClientMetadata *ClientMetadata `protobuf:"bytes,1,opt,name=client_metadata,json=clientMetadata,proto3" json:"client_metadata,omitempty"` - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *InitialCloudProxyRequest) Reset() { - *x = InitialCloudProxyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InitialCloudProxyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitialCloudProxyRequest) ProtoMessage() {} - -func (x *InitialCloudProxyRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitialCloudProxyRequest.ProtoReflect.Descriptor instead. -func (*InitialCloudProxyRequest) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{1} -} - -func (x *InitialCloudProxyRequest) GetClientMetadata() *ClientMetadata { - if x != nil { - return x.ClientMetadata - } - return nil -} - -func (x *InitialCloudProxyRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - type ClientStats struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -233,7 +113,7 @@ type ClientStats struct { func (x *ClientStats) Reset() { *x = ClientStats{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[2] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -246,7 +126,7 @@ func (x *ClientStats) String() string { func (*ClientStats) ProtoMessage() {} func (x *ClientStats) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[2] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -259,7 +139,7 @@ func (x *ClientStats) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientStats.ProtoReflect.Descriptor instead. func (*ClientStats) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{1} } func (x *ClientStats) GetClientMetadata() *ClientMetadata { @@ -289,7 +169,7 @@ type ClusterResponse struct { func (x *ClusterResponse) Reset() { *x = ClusterResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[3] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -302,7 +182,7 @@ func (x *ClusterResponse) String() string { func (*ClusterResponse) ProtoMessage() {} func (x *ClusterResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[3] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -315,7 +195,7 @@ func (x *ClusterResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClusterResponse.ProtoReflect.Descriptor instead. func (*ClusterResponse) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{3} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2} } func (x *ClusterResponse) GetClientMetadata() *ClientMetadata { @@ -344,14 +224,14 @@ type CloudProxyRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` - HttpRequest *HTTPRequest `protobuf:"bytes,4,opt,name=http_request,json=httpRequest,proto3,oneof" json:"http_request,omitempty"` + MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + HttpRequest *HTTPRequest `protobuf:"bytes,2,opt,name=http_request,json=httpRequest,proto3,oneof" json:"http_request,omitempty"` } func (x *CloudProxyRequest) Reset() { *x = CloudProxyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[4] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -364,7 +244,7 @@ func (x *CloudProxyRequest) String() string { func (*CloudProxyRequest) ProtoMessage() {} func (x *CloudProxyRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[4] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -377,7 +257,7 @@ func (x *CloudProxyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CloudProxyRequest.ProtoReflect.Descriptor instead. func (*CloudProxyRequest) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{4} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{3} } func (x *CloudProxyRequest) GetMessageId() string { @@ -399,16 +279,19 @@ type StreamCloudProxyResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ClientMetadata *ClientMetadata `protobuf:"bytes,1,opt,name=client_metadata,json=clientMetadata,proto3,oneof" json:"client_metadata,omitempty"` - MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` - HttpRequest *HTTPRequest `protobuf:"bytes,3,opt,name=http_request,json=httpRequest,proto3,oneof" json:"http_request,omitempty"` - ConfigurationRequest *ConfigurationRequest `protobuf:"bytes,4,opt,name=configuration_request,json=configurationRequest,proto3,oneof" json:"configuration_request,omitempty"` + ClientMetadata *ClientMetadata `protobuf:"bytes,1,opt,name=client_metadata,json=clientMetadata,proto3,oneof" json:"client_metadata,omitempty"` + MessageId string `protobuf:"bytes,2,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` + // Types that are assignable to Response: + // + // *StreamCloudProxyResponse_HttpRequest + // *StreamCloudProxyResponse_ConfigurationRequest + Response isStreamCloudProxyResponse_Response `protobuf_oneof:"response"` } func (x *StreamCloudProxyResponse) Reset() { *x = StreamCloudProxyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[5] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -421,7 +304,7 @@ func (x *StreamCloudProxyResponse) String() string { func (*StreamCloudProxyResponse) ProtoMessage() {} func (x *StreamCloudProxyResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[5] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -434,7 +317,7 @@ func (x *StreamCloudProxyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StreamCloudProxyResponse.ProtoReflect.Descriptor instead. func (*StreamCloudProxyResponse) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{5} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{4} } func (x *StreamCloudProxyResponse) GetClientMetadata() *ClientMetadata { @@ -451,20 +334,43 @@ func (x *StreamCloudProxyResponse) GetMessageId() string { return "" } +func (m *StreamCloudProxyResponse) GetResponse() isStreamCloudProxyResponse_Response { + if m != nil { + return m.Response + } + return nil +} + func (x *StreamCloudProxyResponse) GetHttpRequest() *HTTPRequest { - if x != nil { + if x, ok := x.GetResponse().(*StreamCloudProxyResponse_HttpRequest); ok { return x.HttpRequest } return nil } func (x *StreamCloudProxyResponse) GetConfigurationRequest() *ConfigurationRequest { - if x != nil { + if x, ok := x.GetResponse().(*StreamCloudProxyResponse_ConfigurationRequest); ok { return x.ConfigurationRequest } return nil } +type isStreamCloudProxyResponse_Response interface { + isStreamCloudProxyResponse_Response() +} + +type StreamCloudProxyResponse_HttpRequest struct { + HttpRequest *HTTPRequest `protobuf:"bytes,3,opt,name=http_request,json=httpRequest,proto3,oneof"` +} + +type StreamCloudProxyResponse_ConfigurationRequest struct { + ConfigurationRequest *ConfigurationRequest `protobuf:"bytes,4,opt,name=configuration_request,json=configurationRequest,proto3,oneof"` +} + +func (*StreamCloudProxyResponse_HttpRequest) isStreamCloudProxyResponse_Response() {} + +func (*StreamCloudProxyResponse_ConfigurationRequest) isStreamCloudProxyResponse_Response() {} + type ConfigurationRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -477,7 +383,7 @@ type ConfigurationRequest struct { func (x *ConfigurationRequest) Reset() { *x = ConfigurationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[6] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -490,7 +396,7 @@ func (x *ConfigurationRequest) String() string { func (*ConfigurationRequest) ProtoMessage() {} func (x *ConfigurationRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[6] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -503,7 +409,7 @@ func (x *ConfigurationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigurationRequest.ProtoReflect.Descriptor instead. func (*ConfigurationRequest) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{6} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{5} } func (x *ConfigurationRequest) GetKeepAlive() int64 { @@ -534,7 +440,7 @@ type HTTPRequest struct { func (x *HTTPRequest) Reset() { *x = HTTPRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[7] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -547,7 +453,7 @@ func (x *HTTPRequest) String() string { func (*HTTPRequest) ProtoMessage() {} func (x *HTTPRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[7] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -560,7 +466,7 @@ func (x *HTTPRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use HTTPRequest.ProtoReflect.Descriptor instead. func (*HTTPRequest) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{7} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{6} } func (x *HTTPRequest) GetMethod() string { @@ -605,7 +511,7 @@ type HTTPResponse struct { func (x *HTTPResponse) Reset() { *x = HTTPResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[8] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -618,7 +524,7 @@ func (x *HTTPResponse) String() string { func (*HTTPResponse) ProtoMessage() {} func (x *HTTPResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[8] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -631,7 +537,7 @@ func (x *HTTPResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HTTPResponse.ProtoReflect.Descriptor instead. func (*HTTPResponse) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{8} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{7} } func (x *HTTPResponse) GetBody() []byte { @@ -673,7 +579,7 @@ type HeaderValue struct { func (x *HeaderValue) Reset() { *x = HeaderValue{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[9] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -686,7 +592,7 @@ func (x *HeaderValue) String() string { func (*HeaderValue) ProtoMessage() {} func (x *HeaderValue) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[9] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -699,7 +605,7 @@ func (x *HeaderValue) ProtoReflect() protoreflect.Message { // Deprecated: Use HeaderValue.ProtoReflect.Descriptor instead. func (*HeaderValue) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{9} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{8} } func (x *HeaderValue) GetValue() []string { @@ -721,7 +627,7 @@ type SendToProxyRequest struct { func (x *SendToProxyRequest) Reset() { *x = SendToProxyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[10] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -734,7 +640,7 @@ func (x *SendToProxyRequest) String() string { func (*SendToProxyRequest) ProtoMessage() {} func (x *SendToProxyRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[10] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -747,7 +653,7 @@ func (x *SendToProxyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SendToProxyRequest.ProtoReflect.Descriptor instead. func (*SendToProxyRequest) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{10} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{9} } func (x *SendToProxyRequest) GetClientMetadata() *ClientMetadata { @@ -776,7 +682,7 @@ type SendToProxyResponse struct { func (x *SendToProxyResponse) Reset() { *x = SendToProxyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[11] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -789,7 +695,7 @@ func (x *SendToProxyResponse) String() string { func (*SendToProxyResponse) ProtoMessage() {} func (x *SendToProxyResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[11] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -802,7 +708,7 @@ func (x *SendToProxyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SendToProxyResponse.ProtoReflect.Descriptor instead. func (*SendToProxyResponse) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{11} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{10} } func (x *SendToProxyResponse) GetHttpResponse() *HTTPResponse { @@ -827,12 +733,13 @@ type ClientMetadata struct { ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"` OrganizationId *string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3,oneof" json:"organization_id,omitempty"` PodName string `protobuf:"bytes,3,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` } func (x *ClientMetadata) Reset() { *x = ClientMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[12] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -845,7 +752,7 @@ func (x *ClientMetadata) String() string { func (*ClientMetadata) ProtoMessage() {} func (x *ClientMetadata) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[12] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -858,7 +765,7 @@ func (x *ClientMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientMetadata.ProtoReflect.Descriptor instead. func (*ClientMetadata) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{12} + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{11} } func (x *ClientMetadata) GetClusterId() string { @@ -882,28 +789,34 @@ func (x *ClientMetadata) GetPodName() string { return "" } +func (x *ClientMetadata) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type ClientStats_Stats struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status ClientStats_Stats_Status `protobuf:"varint,2,opt,name=status,proto3,enum=castai.cloud.proxy.v1alpha.ClientStats_Stats_Status" json:"status,omitempty"` - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // The total number of RPCs that started. - NumCallsStarted int64 `protobuf:"varint,4,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"` + NumCallsStarted int64 `protobuf:"varint,3,opt,name=num_calls_started,json=numCallsStarted,proto3" json:"num_calls_started,omitempty"` // The total number of RPCs that finished. - NumCallsFinished int64 `protobuf:"varint,5,opt,name=num_calls_finished,json=numCallsFinished,proto3" json:"num_calls_finished,omitempty"` + NumCallsFinished int64 `protobuf:"varint,4,opt,name=num_calls_finished,json=numCallsFinished,proto3" json:"num_calls_finished,omitempty"` // The total number of RPCs that failed to reach a server except dropped RPCs. - NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,6,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend,proto3" json:"num_calls_finished_with_client_failed_to_send,omitempty"` + NumCallsFinishedWithClientFailedToSend int64 `protobuf:"varint,5,opt,name=num_calls_finished_with_client_failed_to_send,json=numCallsFinishedWithClientFailedToSend,proto3" json:"num_calls_finished_with_client_failed_to_send,omitempty"` // The total number of RPCs that finished and are known to have been received // by a server. - NumCallsFinishedKnownReceived int64 `protobuf:"varint,7,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived,proto3" json:"num_calls_finished_known_received,omitempty"` + NumCallsFinishedKnownReceived int64 `protobuf:"varint,6,opt,name=num_calls_finished_known_received,json=numCallsFinishedKnownReceived,proto3" json:"num_calls_finished_known_received,omitempty"` } func (x *ClientStats_Stats) Reset() { *x = ClientStats_Stats{} if protoimpl.UnsafeEnabled { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[13] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -916,7 +829,7 @@ func (x *ClientStats_Stats) String() string { func (*ClientStats_Stats) ProtoMessage() {} func (x *ClientStats_Stats) ProtoReflect() protoreflect.Message { - mi := &file_proto_v1alpha_proxy_proto_msgTypes[13] + mi := &file_proto_v1alpha_proxy_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -929,14 +842,7 @@ func (x *ClientStats_Stats) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientStats_Stats.ProtoReflect.Descriptor instead. func (*ClientStats_Stats) Descriptor() ([]byte, []int) { - return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *ClientStats_Stats) GetStatus() ClientStats_Stats_Status { - if x != nil { - return x.Status - } - return ClientStats_Stats_UNKNOWN + return file_proto_v1alpha_proxy_proto_rawDescGZIP(), []int{1, 0} } func (x *ClientStats_Stats) GetTimestamp() int64 { @@ -980,135 +886,128 @@ var file_proto_v1alpha_proxy_proto_rawDesc = []byte{ 0x0a, 0x19, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x9e, 0x02, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, + 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0xbd, 0x01, 0x0a, 0x17, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x0f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, - 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, - 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, - 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, - 0x61, 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x49, 0x6e, 0x69, - 0x74, 0x69, 0x61, 0x6c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcc, 0x04, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x05, 0x73, 0x74, 0x61, - 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, - 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0xa2, - 0x03, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x4c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, - 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, - 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, - 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x75, - 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x12, 0x5d, - 0x0a, 0x2d, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, - 0x73, 0x68, 0x65, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x6e, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x48, 0x0a, - 0x21, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x65, 0x64, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, - 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, - 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x52, - 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0x2a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, - 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4c, 0x4f, 0x53, 0x49, 0x4e, - 0x47, 0x10, 0x02, 0x22, 0xed, 0x01, 0x0a, 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, - 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, - 0x12, 0x4d, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x22, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, - 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, - 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x8f, 0x03, 0x0a, 0x18, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, + 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, + 0x74, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x12, 0x49, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xd2, 0x03, 0x0a, 0x0b, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, - 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, - 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, - 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, - 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, - 0x01, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, - 0x01, 0x12, 0x6a, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x48, 0x02, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, - 0x10, 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x63, 0x0a, 0x14, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, - 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, - 0x69, 0x76, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, 0x61, 0x6c, 0x69, 0x76, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x10, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x22, 0x90, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x17, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, - 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x43, 0x0a, 0x05, + 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x61, + 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, + 0x74, 0x61, 0x74, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x73, 0x1a, 0xa8, 0x02, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2a, 0x0a, 0x11, 0x6e, 0x75, 0x6d, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, + 0x6c, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, + 0x68, 0x65, 0x64, 0x12, 0x5d, 0x0a, 0x2d, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, + 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, + 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x5f, + 0x73, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x26, 0x6e, 0x75, 0x6d, 0x43, + 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x57, 0x69, 0x74, 0x68, + 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x54, 0x6f, 0x53, 0x65, + 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x73, 0x5f, + 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x72, + 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x6e, + 0x75, 0x6d, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x4b, + 0x6e, 0x6f, 0x77, 0x6e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x22, 0xed, 0x01, 0x0a, + 0x0f, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4d, 0x0a, 0x0d, 0x68, 0x74, 0x74, + 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, + 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, + 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x94, 0x01, 0x0a, + 0x11, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, + 0x64, 0x12, 0x4f, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x48, 0x00, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x88, + 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0xea, 0x02, 0x0a, 0x18, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, + 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x58, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x4c, 0x0a, 0x0c, 0x68, 0x74, 0x74, + 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, + 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, + 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, + 0x5f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x63, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x65, 0x70, + 0x5f, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6b, 0x65, + 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x65, 0x65, 0x70, 0x5f, + 0x61, 0x6c, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x10, 0x6b, 0x65, 0x65, 0x70, 0x41, 0x6c, 0x69, 0x76, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x90, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, + 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x07, 0x68, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x63, 0x61, + 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, + 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, + 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, + 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa3, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, + 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, + 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x4f, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, @@ -1117,77 +1016,61 @@ var file_proto_v1alpha_proxy_proto_rawDesc = []byte{ 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, - 0x62, 0x6f, 0x64, 0x79, 0x22, 0xa3, 0x02, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x88, 0x01, 0x01, 0x12, 0x19, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x4f, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x1a, 0x63, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, + 0x62, 0x6f, 0x64, 0x79, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x23, + 0x0a, 0x0b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x22, 0xb5, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x62, 0x6f, 0x64, 0x79, - 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x23, 0x0a, 0x0b, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xb5, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4a, 0x0a, 0x0c, 0x68, - 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, - 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x68, 0x74, 0x74, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x13, 0x53, 0x65, 0x6e, 0x64, 0x54, - 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, - 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, + 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 0x0e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x4a, 0x0a, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x12, - 0x0a, 0x10, 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x32, 0x87, 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, - 0x79, 0x41, 0x50, 0x49, 0x12, 0x83, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, - 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x33, 0x2e, 0x63, 0x61, 0x73, 0x74, - 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, - 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, - 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73, 0x74, - 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x61, 0x73, 0x74, + 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, + 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, 0x0a, 0x13, 0x53, + 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0d, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x49, 0x5a, 0x47, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x61, - 0x69, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x52, 0x0c, 0x68, 0x74, 0x74, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0xa6, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x6f, 0x72, 0x67, + 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x6f, 0x64, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x6f, 0x64, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x12, 0x0a, 0x10, + 0x5f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x32, 0x87, 0x02, 0x0a, 0x0d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, + 0x50, 0x49, 0x12, 0x83, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, + 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x33, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, + 0x61, 0x73, 0x74, 0x61, 0x69, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, + 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x50, 0x72, 0x6f, 0x78, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x61, 0x73, 0x74, 0x61, 0x69, 0x2f, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x3b, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x76, 0x31, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1202,57 +1085,51 @@ func file_proto_v1alpha_proxy_proto_rawDescGZIP() []byte { return file_proto_v1alpha_proxy_proto_rawDescData } -var file_proto_v1alpha_proxy_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_v1alpha_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_proto_v1alpha_proxy_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_proto_v1alpha_proxy_proto_goTypes = []any{ - (ClientStats_Stats_Status)(0), // 0: castai.cloud.proxy.v1alpha.ClientStats.Stats.Status - (*StreamCloudProxyRequest)(nil), // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest - (*InitialCloudProxyRequest)(nil), // 2: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest - (*ClientStats)(nil), // 3: castai.cloud.proxy.v1alpha.ClientStats - (*ClusterResponse)(nil), // 4: castai.cloud.proxy.v1alpha.ClusterResponse - (*CloudProxyRequest)(nil), // 5: castai.cloud.proxy.v1alpha.CloudProxyRequest - (*StreamCloudProxyResponse)(nil), // 6: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse - (*ConfigurationRequest)(nil), // 7: castai.cloud.proxy.v1alpha.ConfigurationRequest - (*HTTPRequest)(nil), // 8: castai.cloud.proxy.v1alpha.HTTPRequest - (*HTTPResponse)(nil), // 9: castai.cloud.proxy.v1alpha.HTTPResponse - (*HeaderValue)(nil), // 10: castai.cloud.proxy.v1alpha.HeaderValue - (*SendToProxyRequest)(nil), // 11: castai.cloud.proxy.v1alpha.SendToProxyRequest - (*SendToProxyResponse)(nil), // 12: castai.cloud.proxy.v1alpha.SendToProxyResponse - (*ClientMetadata)(nil), // 13: castai.cloud.proxy.v1alpha.ClientMetadata - (*ClientStats_Stats)(nil), // 14: castai.cloud.proxy.v1alpha.ClientStats.Stats - nil, // 15: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - nil, // 16: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + (*StreamCloudProxyRequest)(nil), // 0: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest + (*ClientStats)(nil), // 1: castai.cloud.proxy.v1alpha.ClientStats + (*ClusterResponse)(nil), // 2: castai.cloud.proxy.v1alpha.ClusterResponse + (*CloudProxyRequest)(nil), // 3: castai.cloud.proxy.v1alpha.CloudProxyRequest + (*StreamCloudProxyResponse)(nil), // 4: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse + (*ConfigurationRequest)(nil), // 5: castai.cloud.proxy.v1alpha.ConfigurationRequest + (*HTTPRequest)(nil), // 6: castai.cloud.proxy.v1alpha.HTTPRequest + (*HTTPResponse)(nil), // 7: castai.cloud.proxy.v1alpha.HTTPResponse + (*HeaderValue)(nil), // 8: castai.cloud.proxy.v1alpha.HeaderValue + (*SendToProxyRequest)(nil), // 9: castai.cloud.proxy.v1alpha.SendToProxyRequest + (*SendToProxyResponse)(nil), // 10: castai.cloud.proxy.v1alpha.SendToProxyResponse + (*ClientMetadata)(nil), // 11: castai.cloud.proxy.v1alpha.ClientMetadata + (*ClientStats_Stats)(nil), // 12: castai.cloud.proxy.v1alpha.ClientStats.Stats + nil, // 13: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + nil, // 14: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry } var file_proto_v1alpha_proxy_proto_depIdxs = []int32{ - 2, // 0: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.initial_request:type_name -> castai.cloud.proxy.v1alpha.InitialCloudProxyRequest - 3, // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats - 4, // 2: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> castai.cloud.proxy.v1alpha.ClusterResponse - 13, // 3: castai.cloud.proxy.v1alpha.InitialCloudProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 13, // 4: castai.cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 14, // 5: castai.cloud.proxy.v1alpha.ClientStats.stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Stats - 13, // 6: castai.cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 9, // 7: castai.cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse - 8, // 8: castai.cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 13, // 9: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 8, // 10: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 7, // 11: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> castai.cloud.proxy.v1alpha.ConfigurationRequest - 15, // 12: castai.cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry - 16, // 13: castai.cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry - 13, // 14: castai.cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata - 8, // 15: castai.cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest - 9, // 16: castai.cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse - 0, // 17: castai.cloud.proxy.v1alpha.ClientStats.Stats.status:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Stats.Status - 10, // 18: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue - 10, // 19: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue - 1, // 20: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyRequest - 11, // 21: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> castai.cloud.proxy.v1alpha.SendToProxyRequest - 6, // 22: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyResponse - 12, // 23: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> castai.cloud.proxy.v1alpha.SendToProxyResponse - 22, // [22:24] is the sub-list for method output_type - 20, // [20:22] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 1, // 0: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.client_stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats + 2, // 1: castai.cloud.proxy.v1alpha.StreamCloudProxyRequest.response:type_name -> castai.cloud.proxy.v1alpha.ClusterResponse + 11, // 2: castai.cloud.proxy.v1alpha.ClientStats.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 12, // 3: castai.cloud.proxy.v1alpha.ClientStats.stats:type_name -> castai.cloud.proxy.v1alpha.ClientStats.Stats + 11, // 4: castai.cloud.proxy.v1alpha.ClusterResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 7, // 5: castai.cloud.proxy.v1alpha.ClusterResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse + 6, // 6: castai.cloud.proxy.v1alpha.CloudProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 11, // 7: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 6, // 8: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 5, // 9: castai.cloud.proxy.v1alpha.StreamCloudProxyResponse.configuration_request:type_name -> castai.cloud.proxy.v1alpha.ConfigurationRequest + 13, // 10: castai.cloud.proxy.v1alpha.HTTPRequest.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry + 14, // 11: castai.cloud.proxy.v1alpha.HTTPResponse.headers:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry + 11, // 12: castai.cloud.proxy.v1alpha.SendToProxyRequest.client_metadata:type_name -> castai.cloud.proxy.v1alpha.ClientMetadata + 6, // 13: castai.cloud.proxy.v1alpha.SendToProxyRequest.http_request:type_name -> castai.cloud.proxy.v1alpha.HTTPRequest + 7, // 14: castai.cloud.proxy.v1alpha.SendToProxyResponse.http_response:type_name -> castai.cloud.proxy.v1alpha.HTTPResponse + 8, // 15: castai.cloud.proxy.v1alpha.HTTPRequest.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue + 8, // 16: castai.cloud.proxy.v1alpha.HTTPResponse.HeadersEntry.value:type_name -> castai.cloud.proxy.v1alpha.HeaderValue + 0, // 17: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:input_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyRequest + 9, // 18: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:input_type -> castai.cloud.proxy.v1alpha.SendToProxyRequest + 4, // 19: castai.cloud.proxy.v1alpha.CloudProxyAPI.StreamCloudProxy:output_type -> castai.cloud.proxy.v1alpha.StreamCloudProxyResponse + 10, // 20: castai.cloud.proxy.v1alpha.CloudProxyAPI.SendToProxy:output_type -> castai.cloud.proxy.v1alpha.SendToProxyResponse + 19, // [19:21] is the sub-list for method output_type + 17, // [17:19] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_proto_v1alpha_proxy_proto_init() } @@ -1274,18 +1151,6 @@ func file_proto_v1alpha_proxy_proto_init() { } } file_proto_v1alpha_proxy_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*InitialCloudProxyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_v1alpha_proxy_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*ClientStats); i { case 0: return &v.state @@ -1297,7 +1162,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*ClusterResponse); i { case 0: return &v.state @@ -1309,7 +1174,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*CloudProxyRequest); i { case 0: return &v.state @@ -1321,7 +1186,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*StreamCloudProxyResponse); i { case 0: return &v.state @@ -1333,7 +1198,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*ConfigurationRequest); i { case 0: return &v.state @@ -1345,7 +1210,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*HTTPRequest); i { case 0: return &v.state @@ -1357,7 +1222,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*HTTPResponse); i { case 0: return &v.state @@ -1369,7 +1234,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*HeaderValue); i { case 0: return &v.state @@ -1381,7 +1246,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*SendToProxyRequest); i { case 0: return &v.state @@ -1393,7 +1258,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*SendToProxyResponse); i { case 0: return &v.state @@ -1405,7 +1270,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ClientMetadata); i { case 0: return &v.state @@ -1417,7 +1282,7 @@ func file_proto_v1alpha_proxy_proto_init() { return nil } } - file_proto_v1alpha_proxy_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_proto_v1alpha_proxy_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ClientStats_Stats); i { case 0: return &v.state @@ -1431,29 +1296,30 @@ func file_proto_v1alpha_proxy_proto_init() { } } file_proto_v1alpha_proxy_proto_msgTypes[0].OneofWrappers = []any{ - (*StreamCloudProxyRequest_InitialRequest)(nil), (*StreamCloudProxyRequest_ClientStats)(nil), (*StreamCloudProxyRequest_Response)(nil), } + file_proto_v1alpha_proxy_proto_msgTypes[2].OneofWrappers = []any{} file_proto_v1alpha_proxy_proto_msgTypes[3].OneofWrappers = []any{} - file_proto_v1alpha_proxy_proto_msgTypes[4].OneofWrappers = []any{} - file_proto_v1alpha_proxy_proto_msgTypes[5].OneofWrappers = []any{} + file_proto_v1alpha_proxy_proto_msgTypes[4].OneofWrappers = []any{ + (*StreamCloudProxyResponse_HttpRequest)(nil), + (*StreamCloudProxyResponse_ConfigurationRequest)(nil), + } + file_proto_v1alpha_proxy_proto_msgTypes[6].OneofWrappers = []any{} file_proto_v1alpha_proxy_proto_msgTypes[7].OneofWrappers = []any{} - file_proto_v1alpha_proxy_proto_msgTypes[8].OneofWrappers = []any{} - file_proto_v1alpha_proxy_proto_msgTypes[12].OneofWrappers = []any{} + file_proto_v1alpha_proxy_proto_msgTypes[11].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_v1alpha_proxy_proto_rawDesc, - NumEnums: 1, - NumMessages: 16, + NumEnums: 0, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, GoTypes: file_proto_v1alpha_proxy_proto_goTypes, DependencyIndexes: file_proto_v1alpha_proxy_proto_depIdxs, - EnumInfos: file_proto_v1alpha_proxy_proto_enumTypes, MessageInfos: file_proto_v1alpha_proxy_proto_msgTypes, }.Build() File_proto_v1alpha_proxy_proto = out.File diff --git a/proto/v1alpha/proxy.proto b/proto/v1alpha/proxy.proto index 3db2f15..64be4d1 100644 --- a/proto/v1alpha/proxy.proto +++ b/proto/v1alpha/proxy.proto @@ -19,48 +19,31 @@ service CloudProxyAPI { message StreamCloudProxyRequest { oneof request { - // Initial request to establish the connection. - InitialCloudProxyRequest initial_request = 1; ClientStats client_stats = 2; ClusterResponse response = 3; } } -message InitialCloudProxyRequest { - ClientMetadata client_metadata = 1; - string version = 2; -} - - message ClientStats { ClientMetadata client_metadata = 1; message Stats { - // Status of the cluster client. - enum Status { - UNKNOWN = 0; - OK = 1; - CLOSING = 2; - } - Status status = 2; - - int64 timestamp = 3; + int64 timestamp = 2; // The total number of RPCs that started. - int64 num_calls_started = 4; + int64 num_calls_started = 3; // The total number of RPCs that finished. - int64 num_calls_finished = 5; + int64 num_calls_finished = 4; // The total number of RPCs that failed to reach a server except dropped RPCs. - int64 num_calls_finished_with_client_failed_to_send = 6; + int64 num_calls_finished_with_client_failed_to_send = 5; // The total number of RPCs that finished and are known to have been received // by a server. - int64 num_calls_finished_known_received = 7; + int64 num_calls_finished_known_received = 6; } Stats stats = 2; } - message ClusterResponse { optional ClientMetadata client_metadata = 1; string message_id = 2; @@ -68,15 +51,17 @@ message ClusterResponse { } message CloudProxyRequest { - string message_id = 3; - optional HTTPRequest http_request = 4; + string message_id = 1; + optional HTTPRequest http_request = 2; } message StreamCloudProxyResponse { optional ClientMetadata client_metadata = 1; string message_id = 2; - optional HTTPRequest http_request = 3; - optional ConfigurationRequest configuration_request = 4; + oneof response { + HTTPRequest http_request = 3; + ConfigurationRequest configuration_request = 4; + } } message ConfigurationRequest { @@ -116,4 +101,5 @@ message ClientMetadata { string cluster_id = 1; optional string organization_id = 2; string pod_name = 3; + string version = 4; }