From 55d1e8ad1d8cc3481253d8671eea3665a4fe2acf Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Fri, 14 Jun 2024 17:41:16 +0300 Subject: [PATCH] update the event type messages --- .../cloudmigrationimpl/cloudmigration.go | 9 +- .../cloudmigrationimpl/cloudmigration_noop.go | 30 +- .../cloudmigrationimpl/cloudmigration_test.go | 15 +- pkg/storage/unified/apistore/storage.go | 178 +---- pkg/storage/unified/apistore/stream.go | 203 ++++++ pkg/storage/unified/resource/fs.go | 2 +- pkg/storage/unified/resource/noop.go | 26 +- pkg/storage/unified/resource/resource.pb.go | 618 +++++++++++------- pkg/storage/unified/resource/resource.proto | 33 +- .../unified/resource/resource_grpc.pb.go | 10 +- pkg/storage/unified/resource/server.go | 6 +- .../unified/sqlstash/sql_storage_server.go | 6 +- pkg/storage/unified/sqlstash/watch.go | 8 +- 13 files changed, 675 insertions(+), 469 deletions(-) create mode 100644 pkg/storage/unified/apistore/stream.go diff --git a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration.go b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration.go index de5982af442..6d80282e857 100644 --- a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration.go +++ b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration.go @@ -9,6 +9,10 @@ import ( "net/http" "time" + "github.com/prometheus/client_golang/prometheus" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" + "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/infra/db" @@ -25,9 +29,6 @@ import ( "github.com/grafana/grafana/pkg/services/gcom" "github.com/grafana/grafana/pkg/services/secrets" "github.com/grafana/grafana/pkg/setting" - "github.com/prometheus/client_golang/prometheus" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/trace" ) // Service Define the cloudmigration.Service Implementation. @@ -77,7 +78,7 @@ func ProvideService( folderService folder.Service, ) (cloudmigration.Service, error) { if !features.IsEnabledGlobally(featuremgmt.FlagOnPremToCloudMigrations) { - return &NoopServiceImpl{}, nil + return &noopServiceImpl{}, nil } s := &Service{ diff --git a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_noop.go b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_noop.go index 2f7a808f118..4439bb9b926 100644 --- a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_noop.go +++ b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_noop.go @@ -7,55 +7,55 @@ import ( "github.com/grafana/grafana/pkg/services/gcom" ) -// NoopServiceImpl Define the Service Implementation. -type NoopServiceImpl struct{} +// noopServiceImpl Define the Service Implementation. +type noopServiceImpl struct{} -var _ cloudmigration.Service = (*NoopServiceImpl)(nil) +var _ cloudmigration.Service = (*noopServiceImpl)(nil) -func (s *NoopServiceImpl) GetToken(ctx context.Context) (gcom.TokenView, error) { +func (s *noopServiceImpl) GetToken(ctx context.Context) (gcom.TokenView, error) { return gcom.TokenView{}, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) CreateToken(ctx context.Context) (cloudmigration.CreateAccessTokenResponse, error) { +func (s *noopServiceImpl) CreateToken(ctx context.Context) (cloudmigration.CreateAccessTokenResponse, error) { return cloudmigration.CreateAccessTokenResponse{}, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) DeleteToken(ctx context.Context, uid string) error { +func (s *noopServiceImpl) DeleteToken(ctx context.Context, uid string) error { return cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) ValidateToken(ctx context.Context, cm cloudmigration.CloudMigrationSession) error { +func (s *noopServiceImpl) ValidateToken(ctx context.Context, cm cloudmigration.CloudMigrationSession) error { return cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) GetSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) { +func (s *noopServiceImpl) GetSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) GetSessionList(ctx context.Context) (*cloudmigration.CloudMigrationSessionListResponse, error) { +func (s *noopServiceImpl) GetSessionList(ctx context.Context) (*cloudmigration.CloudMigrationSessionListResponse, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) CreateSession(ctx context.Context, cm cloudmigration.CloudMigrationSessionRequest) (*cloudmigration.CloudMigrationSessionResponse, error) { +func (s *noopServiceImpl) CreateSession(ctx context.Context, cm cloudmigration.CloudMigrationSessionRequest) (*cloudmigration.CloudMigrationSessionResponse, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) GetMigrationStatus(ctx context.Context, runUID string) (*cloudmigration.CloudMigrationSnapshot, error) { +func (s *noopServiceImpl) GetMigrationStatus(ctx context.Context, runUID string) (*cloudmigration.CloudMigrationSnapshot, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) GetMigrationRunList(ctx context.Context, uid string) (*cloudmigration.SnapshotList, error) { +func (s *noopServiceImpl) GetMigrationRunList(ctx context.Context, uid string) (*cloudmigration.SnapshotList, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) DeleteSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) { +func (s *noopServiceImpl) DeleteSession(ctx context.Context, uid string) (*cloudmigration.CloudMigrationSession, error) { return nil, cloudmigration.ErrFeatureDisabledError } -func (s *NoopServiceImpl) CreateMigrationRun(context.Context, cloudmigration.CloudMigrationSnapshot) (string, error) { +func (s *noopServiceImpl) CreateMigrationRun(context.Context, cloudmigration.CloudMigrationSnapshot) (string, error) { return "", cloudmigration.ErrInternalNotImplementedError } -func (s *NoopServiceImpl) RunMigration(context.Context, string) (*cloudmigration.MigrateDataResponse, error) { +func (s *noopServiceImpl) RunMigration(context.Context, string) (*cloudmigration.MigrateDataResponse, error) { return nil, cloudmigration.ErrFeatureDisabledError } diff --git a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_test.go b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_test.go index 9f4b1d1e4ec..4c2121c9a14 100644 --- a/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_test.go +++ b/pkg/services/cloudmigration/cloudmigrationimpl/cloudmigration_test.go @@ -4,6 +4,12 @@ import ( "context" "testing" + "github.com/prometheus/client_golang/prometheus" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel/sdk/trace/tracetest" + "github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/db" @@ -20,15 +26,10 @@ import ( secretsfakes "github.com/grafana/grafana/pkg/services/secrets/fakes" "github.com/grafana/grafana/pkg/services/user" "github.com/grafana/grafana/pkg/setting" - "github.com/prometheus/client_golang/prometheus" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/sdk/trace/tracetest" ) -func Test_NoopServiceDoesNothing(t *testing.T) { - s := &NoopServiceImpl{} +func Test_noopServiceDoesNothing(t *testing.T) { + s := &noopServiceImpl{} _, e := s.CreateToken(context.Background()) assert.ErrorIs(t, e, cloudmigration.ErrFeatureDisabledError) } diff --git a/pkg/storage/unified/apistore/storage.go b/pkg/storage/unified/apistore/storage.go index ec23c14cc1a..446b238daa0 100644 --- a/pkg/storage/unified/apistore/storage.go +++ b/pkg/storage/unified/apistore/storage.go @@ -16,8 +16,6 @@ import ( "strings" "time" - grpcCodes "google.golang.org/grpc/codes" - grpcStatus "google.golang.org/grpc/status" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -30,7 +28,6 @@ import ( "k8s.io/apiserver/pkg/storage" "k8s.io/apiserver/pkg/storage/storagebackend" "k8s.io/apiserver/pkg/storage/storagebackend/factory" - "k8s.io/klog/v2" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/infra/appcontext" @@ -257,7 +254,7 @@ func (s *Storage) Watch(ctx context.Context, _ string, opts storage.ListOptions) } reporter := apierrors.NewClientErrorReporter(500, "WATCH", "") - decoder := &Decoder{ + decoder := &streamDecoder{ client: client, newFunc: s.newFunc, opts: opts, @@ -566,176 +563,3 @@ func (s *Storage) Versioner() storage.Versioner { func (s *Storage) RequestWatchProgress(ctx context.Context) error { return nil } - -type Decoder struct { - client resource.ResourceStore_WatchClient - newFunc func() runtime.Object - opts storage.ListOptions - codec runtime.Codec -} - -func (d *Decoder) toObject(w *resource.ResourceWrapper) (runtime.Object, error) { - obj, _, err := d.codec.Decode(w.Value, nil, d.newFunc()) - if err == nil { - accessor, err := utils.MetaAccessor(obj) - if err != nil { - return nil, err - } - accessor.SetResourceVersionInt64(w.ResourceVersion) - } - return obj, err -} - -func (d *Decoder) Decode() (action watch.EventType, object runtime.Object, err error) { -decode: - for { - err := d.client.Context().Err() - if err != nil { - klog.Errorf("client: context error: %s\n", err) - return watch.Error, nil, err - } - - resp, err := d.client.Recv() - if errors.Is(err, io.EOF) { - return watch.Error, nil, err - } - - if grpcStatus.Code(err) == grpcCodes.Canceled { - return watch.Error, nil, err - } - - if err != nil { - klog.Errorf("client: error receiving result: %s", err) - return watch.Error, nil, err - } - - if resp.Resource == nil { - klog.Errorf("client: received nil entity\n") - continue decode - } - - if resp.Resource.Operation == resource.ResourceOperation_BOOKMARK { - obj := d.newFunc() - - // here k8s expects an empty object with just resource version and k8s.io/initial-events-end annotation - accessor, err := utils.MetaAccessor(obj) - if err != nil { - klog.Errorf("error getting object accessor: %s", err) - return watch.Error, nil, err - } - - accessor.SetResourceVersionInt64(resp.Resource.ResourceVersion) - accessor.SetAnnotations(map[string]string{"k8s.io/initial-events-end": "true"}) - return watch.Bookmark, obj, nil - } - - obj, err := d.toObject(resp.Resource) - if err != nil { - klog.Errorf("error decoding entity: %s", err) - return watch.Error, nil, err - } - - var watchAction watch.EventType - switch resp.Resource.Operation { - case resource.ResourceOperation_CREATED: - // apply any predicates not handled in storage - matches, err := d.opts.Predicate.Matches(obj) - if err != nil { - klog.Errorf("error matching object: %s", err) - return watch.Error, nil, err - } - if !matches { - continue decode - } - watchAction = watch.Added - - case resource.ResourceOperation_UPDATED: - watchAction = watch.Modified - - // apply any predicates not handled in storage - matches, err := d.opts.Predicate.Matches(obj) - if err != nil { - klog.Errorf("error matching object: %s", err) - return watch.Error, nil, err - } - - // if we have a previous object, check if it matches - var prevObj runtime.Object - prevMatches := false - if resp.Previous != nil { - prevObj, err := d.toObject(resp.Previous) - if err != nil { - klog.Errorf("error decoding entity: %s", err) - return watch.Error, nil, err - } - - // apply any predicates not handled in storage - prevMatches, err = d.opts.Predicate.Matches(prevObj) - if err != nil { - klog.Errorf("error matching object: %s", err) - return watch.Error, nil, err - } - } - - if !matches { - if !prevMatches { - continue decode - } - - // if the object didn't match, send a Deleted event - watchAction = watch.Deleted - - // here k8s expects the previous object but with the new resource version - obj = prevObj - - accessor, err := utils.MetaAccessor(obj) - if err != nil { - klog.Errorf("error getting object accessor: %s", err) - return watch.Error, nil, err - } - accessor.SetResourceVersionInt64(resp.Previous.ResourceVersion) - } else if !prevMatches { - // if the object didn't previously match, send an Added event - watchAction = watch.Added - } - - case resource.ResourceOperation_DELETED: - watchAction = watch.Deleted - - // if we have a previous object, return that in the deleted event - if resp.Previous != nil { - // here k8s expects the previous object but with the new resource version - accessor, err := utils.MetaAccessor(obj) - if err != nil { - klog.Errorf("error getting object accessor: %s", err) - return watch.Error, nil, err - } - - accessor.SetResourceVersionInt64(resp.Previous.ResourceVersion) - } - - // apply any predicates not handled in storage - matches, err := d.opts.Predicate.Matches(obj) - if err != nil { - klog.Errorf("error matching object: %s", err) - return watch.Error, nil, err - } - if !matches { - continue decode - } - default: - watchAction = watch.Error - } - - return watchAction, obj, nil - } -} - -func (d *Decoder) Close() { - err := d.client.CloseSend() - if err != nil { - klog.Errorf("error closing watch stream: %s", err) - } -} - -var _ watch.Decoder = (*Decoder)(nil) diff --git a/pkg/storage/unified/apistore/stream.go b/pkg/storage/unified/apistore/stream.go new file mode 100644 index 00000000000..5c123805743 --- /dev/null +++ b/pkg/storage/unified/apistore/stream.go @@ -0,0 +1,203 @@ +package apistore + +import ( + "errors" + "fmt" + "io" + + grpcCodes "google.golang.org/grpc/codes" + grpcStatus "google.golang.org/grpc/status" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/apiserver/pkg/storage" + "k8s.io/klog/v2" + + "github.com/grafana/grafana/pkg/apimachinery/utils" + "github.com/grafana/grafana/pkg/storage/unified/resource" +) + +type streamDecoder struct { + client resource.ResourceStore_WatchClient + newFunc func() runtime.Object + opts storage.ListOptions + codec runtime.Codec +} + +func (d *streamDecoder) toObject(w *resource.WatchEvent_Resource) (runtime.Object, error) { + obj, _, err := d.codec.Decode(w.Value, nil, d.newFunc()) + if err == nil { + accessor, err := utils.MetaAccessor(obj) + if err != nil { + return nil, err + } + accessor.SetResourceVersionInt64(w.Version) + } + return obj, err +} + +func (d *streamDecoder) Decode() (action watch.EventType, object runtime.Object, err error) { +decode: + for { + err := d.client.Context().Err() + if err != nil { + klog.Errorf("client: context error: %s\n", err) + return watch.Error, nil, err + } + + evt, err := d.client.Recv() + if errors.Is(err, io.EOF) { + return watch.Error, nil, err + } + + if grpcStatus.Code(err) == grpcCodes.Canceled { + return watch.Error, nil, err + } + + if err != nil { + klog.Errorf("client: error receiving result: %s", err) + return watch.Error, nil, err + } + + // Error event + if evt.Type == resource.WatchEvent_ERROR { + err = fmt.Errorf(string(evt.Message)) + klog.Errorf("client: error receiving result: %s", err) + return watch.Error, nil, err + } + + if evt.Resource == nil { + klog.Errorf("client: received nil \n") + continue decode + } + + if evt.Type == resource.WatchEvent_BOOKMARK { + obj := d.newFunc() + + // here k8s expects an empty object with just resource version and k8s.io/initial-events-end annotation + accessor, err := utils.MetaAccessor(obj) + if err != nil { + klog.Errorf("error getting object accessor: %s", err) + return watch.Error, nil, err + } + + accessor.SetResourceVersionInt64(evt.Resource.Version) + accessor.SetAnnotations(map[string]string{"k8s.io/initial-events-end": "true"}) + return watch.Bookmark, obj, nil + } + + obj, err := d.toObject(evt.Resource) + if err != nil { + klog.Errorf("error decoding entity: %s", err) + return watch.Error, nil, err + } + + var watchAction watch.EventType + switch evt.Type { + case resource.WatchEvent_ADDED: + // apply any predicates not handled in storage + matches, err := d.opts.Predicate.Matches(obj) + if err != nil { + klog.Errorf("error matching object: %s", err) + return watch.Error, nil, err + } + if !matches { + continue decode + } + + watchAction = watch.Added + case resource.WatchEvent_MODIFIED: + watchAction = watch.Modified + + // apply any predicates not handled in storage + matches, err := d.opts.Predicate.Matches(obj) + if err != nil { + klog.Errorf("error matching object: %s", err) + return watch.Error, nil, err + } + + // if we have a previous object, check if it matches + prevMatches := false + var prevObj runtime.Object + if evt.Previous != nil { + prevObj, err = d.toObject(evt.Previous) + if err != nil { + klog.Errorf("error decoding entity: %s", err) + return watch.Error, nil, err + } + + // apply any predicates not handled in storage + prevMatches, err = d.opts.Predicate.Matches(prevObj) + if err != nil { + klog.Errorf("error matching object: %s", err) + return watch.Error, nil, err + } + } + + if !matches { + if !prevMatches { + continue decode + } + + // if the object didn't match, send a Deleted event + watchAction = watch.Deleted + + // here k8s expects the previous object but with the new resource version + obj = prevObj + + accessor, err := utils.MetaAccessor(obj) + if err != nil { + klog.Errorf("error getting object accessor: %s", err) + return watch.Error, nil, err + } + + accessor.SetResourceVersionInt64(evt.Resource.Version) + } else if !prevMatches { + // if the object didn't previously match, send an Added event + watchAction = watch.Added + } + case resource.WatchEvent_DELETED: + watchAction = watch.Deleted + + // if we have a previous object, return that in the deleted event + if evt.Previous != nil { + obj, err = d.toObject(evt.Previous) + if err != nil { + klog.Errorf("error decoding entity: %s", err) + return watch.Error, nil, err + } + + // here k8s expects the previous object but with the new resource version + accessor, err := utils.MetaAccessor(obj) + if err != nil { + klog.Errorf("error getting object accessor: %s", err) + return watch.Error, nil, err + } + + accessor.SetResourceVersionInt64(evt.Resource.Version) + } + + // apply any predicates not handled in storage + matches, err := d.opts.Predicate.Matches(obj) + if err != nil { + klog.Errorf("error matching object: %s", err) + return watch.Error, nil, err + } + if !matches { + continue decode + } + default: + watchAction = watch.Error + } + + return watchAction, obj, nil + } +} + +func (d *streamDecoder) Close() { + err := d.client.CloseSend() + if err != nil { + klog.Errorf("error closing watch stream: %s", err) + } +} + +var _ watch.Decoder = (*streamDecoder)(nil) diff --git a/pkg/storage/unified/resource/fs.go b/pkg/storage/unified/resource/fs.go index ba839ade011..14deb57b2f1 100644 --- a/pkg/storage/unified/resource/fs.go +++ b/pkg/storage/unified/resource/fs.go @@ -146,6 +146,6 @@ func (f *fsStore) List(ctx context.Context, req *ListRequest) (*ListResponse, er } // Watch implements AppendingStore. -func (f *fsStore) Watch(context.Context, *WatchRequest) (chan *WatchResponse, error) { +func (f *fsStore) Watch(context.Context, *WatchRequest) (chan *WatchEvent, error) { panic("unimplemented") } diff --git a/pkg/storage/unified/resource/noop.go b/pkg/storage/unified/resource/noop.go index 07a044f29b5..38ae8348f3b 100644 --- a/pkg/storage/unified/resource/noop.go +++ b/pkg/storage/unified/resource/noop.go @@ -3,51 +3,53 @@ package resource import "context" var ( - _ ResourceSearchServer = &NoopServer{} - _ DiagnosticsServer = &NoopServer{} - _ LifecycleHooks = &NoopServer{} + _ ResourceSearchServer = &noopService{} + _ DiagnosticsServer = &noopService{} + _ LifecycleHooks = &noopService{} ) -type NoopServer struct{} +// noopService is a helper implementation to simplify tests +// It does nothing except return errors when asked to do anything real +type noopService struct{} // Init implements ResourceServer. -func (n *NoopServer) Init() error { +func (n *noopService) Init() error { return nil } // Stop implements ResourceServer. -func (n *NoopServer) Stop() { +func (n *noopService) Stop() { // nothing } // IsHealthy implements ResourceServer. -func (n *NoopServer) IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { +func (n *noopService) IsHealthy(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) { return &HealthCheckResponse{ Status: HealthCheckResponse_SERVING, }, nil } // Read implements ResourceServer. -func (n *NoopServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) { +func (n *noopService) Read(context.Context, *ReadRequest) (*ReadResponse, error) { return nil, ErrNotImplementedYet } // List implements ResourceServer. -func (n *NoopServer) List(context.Context, *ListRequest) (*ListResponse, error) { +func (n *noopService) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, ErrNotImplementedYet } // GetBlob implements ResourceServer. -func (n *NoopServer) GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) { +func (n *noopService) GetBlob(context.Context, *GetBlobRequest) (*GetBlobResponse, error) { return nil, ErrNotImplementedYet } // History implements ResourceServer. -func (n *NoopServer) History(context.Context, *HistoryRequest) (*HistoryResponse, error) { +func (n *noopService) History(context.Context, *HistoryRequest) (*HistoryResponse, error) { return nil, ErrNotImplementedYet } // Origin implements ResourceServer. -func (n *NoopServer) Origin(context.Context, *OriginRequest) (*OriginResponse, error) { +func (n *noopService) Origin(context.Context, *OriginRequest) (*OriginResponse, error) { return nil, ErrNotImplementedYet } diff --git a/pkg/storage/unified/resource/resource.pb.go b/pkg/storage/unified/resource/resource.pb.go index 9b4b2c718f2..c6fce0e557c 100644 --- a/pkg/storage/unified/resource/resource.pb.go +++ b/pkg/storage/unified/resource/resource.pb.go @@ -23,11 +23,10 @@ const ( type ResourceOperation int32 const ( - ResourceOperation_UNKNOWN ResourceOperation = 0 - ResourceOperation_CREATED ResourceOperation = 1 - ResourceOperation_UPDATED ResourceOperation = 2 - ResourceOperation_DELETED ResourceOperation = 3 - ResourceOperation_BOOKMARK ResourceOperation = 4 + ResourceOperation_UNKNOWN ResourceOperation = 0 + ResourceOperation_CREATED ResourceOperation = 1 + ResourceOperation_UPDATED ResourceOperation = 2 + ResourceOperation_DELETED ResourceOperation = 3 ) // Enum value maps for ResourceOperation. @@ -37,14 +36,12 @@ var ( 1: "CREATED", 2: "UPDATED", 3: "DELETED", - 4: "BOOKMARK", } ResourceOperation_value = map[string]int32{ - "UNKNOWN": 0, - "CREATED": 1, - "UPDATED": 2, - "DELETED": 3, - "BOOKMARK": 4, + "UNKNOWN": 0, + "CREATED": 1, + "UPDATED": 2, + "DELETED": 3, } ) @@ -222,6 +219,64 @@ func (Sort_Order) EnumDescriptor() ([]byte, []int) { return file_resource_proto_rawDescGZIP(), []int{17, 0} } +type WatchEvent_Type int32 + +const ( + WatchEvent_UNKNOWN WatchEvent_Type = 0 + WatchEvent_ADDED WatchEvent_Type = 1 + WatchEvent_MODIFIED WatchEvent_Type = 2 + WatchEvent_DELETED WatchEvent_Type = 3 + WatchEvent_BOOKMARK WatchEvent_Type = 4 + WatchEvent_ERROR WatchEvent_Type = 5 +) + +// Enum value maps for WatchEvent_Type. +var ( + WatchEvent_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ADDED", + 2: "MODIFIED", + 3: "DELETED", + 4: "BOOKMARK", + 5: "ERROR", + } + WatchEvent_Type_value = map[string]int32{ + "UNKNOWN": 0, + "ADDED": 1, + "MODIFIED": 2, + "DELETED": 3, + "BOOKMARK": 4, + "ERROR": 5, + } +) + +func (x WatchEvent_Type) Enum() *WatchEvent_Type { + p := new(WatchEvent_Type) + *p = x + return p +} + +func (x WatchEvent_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WatchEvent_Type) Descriptor() protoreflect.EnumDescriptor { + return file_resource_proto_enumTypes[4].Descriptor() +} + +func (WatchEvent_Type) Type() protoreflect.EnumType { + return &file_resource_proto_enumTypes[4] +} + +func (x WatchEvent_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WatchEvent_Type.Descriptor instead. +func (WatchEvent_Type) EnumDescriptor() ([]byte, []int) { + return file_resource_proto_rawDescGZIP(), []int{22, 0} +} + type HealthCheckResponse_ServingStatus int32 const ( @@ -258,11 +313,11 @@ func (x HealthCheckResponse_ServingStatus) String() string { } func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor { - return file_resource_proto_enumTypes[4].Descriptor() + return file_resource_proto_enumTypes[5].Descriptor() } func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType { - return &file_resource_proto_enumTypes[4] + return &file_resource_proto_enumTypes[5] } func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber { @@ -1857,21 +1912,25 @@ func (x *WatchRequest) GetAllowWatchBookmarks() bool { return false } -type WatchResponse struct { +type WatchEvent struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Timestamp the event was sent Timestamp int64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Entity that was created, updated, or deleted - Resource *ResourceWrapper `protobuf:"bytes,2,opt,name=resource,proto3" json:"resource,omitempty"` - // previous version of the entity (in update+delete events) - Previous *ResourceWrapper `protobuf:"bytes,3,opt,name=previous,proto3" json:"previous,omitempty"` + // Timestamp the event was sent + Type WatchEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=resource.WatchEvent_Type" json:"type,omitempty"` + // Resource version for the object + Resource *WatchEvent_Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"` + // Previous resource version (for update+delete) + Previous *WatchEvent_Resource `protobuf:"bytes,4,opt,name=previous,proto3" json:"previous,omitempty"` + // The commit message that triggered this change + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` } -func (x *WatchResponse) Reset() { - *x = WatchResponse{} +func (x *WatchEvent) Reset() { + *x = WatchEvent{} if protoimpl.UnsafeEnabled { mi := &file_resource_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1879,13 +1938,13 @@ func (x *WatchResponse) Reset() { } } -func (x *WatchResponse) String() string { +func (x *WatchEvent) String() string { return protoimpl.X.MessageStringOf(x) } -func (*WatchResponse) ProtoMessage() {} +func (*WatchEvent) ProtoMessage() {} -func (x *WatchResponse) ProtoReflect() protoreflect.Message { +func (x *WatchEvent) ProtoReflect() protoreflect.Message { mi := &file_resource_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1897,32 +1956,46 @@ func (x *WatchResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead. -func (*WatchResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use WatchEvent.ProtoReflect.Descriptor instead. +func (*WatchEvent) Descriptor() ([]byte, []int) { return file_resource_proto_rawDescGZIP(), []int{22} } -func (x *WatchResponse) GetTimestamp() int64 { +func (x *WatchEvent) GetTimestamp() int64 { if x != nil { return x.Timestamp } return 0 } -func (x *WatchResponse) GetResource() *ResourceWrapper { +func (x *WatchEvent) GetType() WatchEvent_Type { + if x != nil { + return x.Type + } + return WatchEvent_UNKNOWN +} + +func (x *WatchEvent) GetResource() *WatchEvent_Resource { if x != nil { return x.Resource } return nil } -func (x *WatchResponse) GetPrevious() *ResourceWrapper { +func (x *WatchEvent) GetPrevious() *WatchEvent_Resource { if x != nil { return x.Previous } return nil } +func (x *WatchEvent) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + type HistoryRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2399,6 +2472,61 @@ func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus { return HealthCheckResponse_UNKNOWN } +type WatchEvent_Resource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version int64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *WatchEvent_Resource) Reset() { + *x = WatchEvent_Resource{} + if protoimpl.UnsafeEnabled { + mi := &file_resource_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WatchEvent_Resource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WatchEvent_Resource) ProtoMessage() {} + +func (x *WatchEvent_Resource) ProtoReflect() protoreflect.Message { + mi := &file_resource_proto_msgTypes[30] + 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 WatchEvent_Resource.ProtoReflect.Descriptor instead. +func (*WatchEvent_Resource) Descriptor() ([]byte, []int) { + return file_resource_proto_rawDescGZIP(), []int{22, 0} +} + +func (x *WatchEvent_Resource) GetVersion() int64 { + if x != nil { + return x.Version + } + return 0 +} + +func (x *WatchEvent_Resource) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + var File_resource_proto protoreflect.FileDescriptor var file_resource_proto_rawDesc = []byte{ @@ -2605,92 +2733,105 @@ var file_resource_proto_rawDesc = []byte{ 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x62, 0x6f, 0x6f, 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x57, 0x61, 0x74, 0x63, 0x68, 0x42, 0x6f, 0x6f, - 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x0d, 0x57, 0x61, 0x74, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, - 0x70, 0x65, 0x72, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x35, 0x0a, - 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, - 0x69, 0x6f, 0x75, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, - 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, - 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x64, 0x22, 0x92, 0x01, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, - 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, - 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x6b, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x22, 0xf9, 0x02, 0x0a, 0x0a, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, + 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x39, 0x0a, + 0x08, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, + 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x1a, 0x3a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x52, + 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, + 0x0a, 0x08, 0x4d, 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x4f, 0x4f, + 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x10, 0x05, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, + 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, + 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, + 0x73, 0x68, 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, + 0x92, 0x01, 0x0a, 0x0f, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x16, 0x0a, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xe5, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, 0x65, 0x79, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xe5, 0x01, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x27, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, - 0x65, 0x79, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, - 0x97, 0x01, 0x0a, 0x0e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x43, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, - 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, - 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, - 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, - 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x2a, 0x55, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, - 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, - 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x4f, 0x4f, 0x4b, 0x4d, 0x41, 0x52, 0x4b, 0x10, 0x04, 0x2a, 0x33, + 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x97, 0x01, + 0x0a, 0x0e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x32, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x69, + 0x74, 0x65, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, + 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x29, 0x0a, 0x10, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x2e, 0x0a, 0x12, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0xab, 0x01, 0x0a, 0x13, 0x48, 0x65, 0x61, 0x6c, + 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x43, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x2b, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x22, 0x4f, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, + 0x0f, 0x0a, 0x0b, 0x4e, 0x4f, 0x54, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x4e, 0x47, 0x10, 0x02, + 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x03, 0x2a, 0x47, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x52, 0x45, 0x41, 0x54, + 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, + 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x2a, 0x33, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x6f, 0x74, 0x4f, 0x6c, 0x64, 0x65, 0x72, 0x54, 0x68, 0x61, 0x6e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x78, 0x61, 0x63, - 0x74, 0x10, 0x01, 0x32, 0xf0, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x74, 0x10, 0x01, 0x32, 0xed, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, @@ -2709,37 +2850,37 @@ var file_resource_proto_rawDesc = []byte{ 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x05, 0x57, 0x61, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x32, 0x84, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x35, 0x0a, 0x04, 0x52, 0x65, 0x61, - 0x64, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x18, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3e, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x2e, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3b, 0x0a, 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x57, 0x0a, - 0x0b, 0x44, 0x69, 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x48, 0x0a, 0x09, - 0x49, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x67, 0x72, 0x61, - 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2f, 0x75, 0x6e, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x57, 0x61, 0x74, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x30, 0x01, 0x32, 0x84, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x35, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, 0x15, + 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x47, 0x65, + 0x74, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, + 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x06, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x4f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x57, 0x0a, 0x0b, 0x44, 0x69, + 0x61, 0x67, 0x6e, 0x6f, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x48, 0x0a, 0x09, 0x49, 0x73, 0x48, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x2e, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, + 0x61, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x75, 0x6e, + 0x69, 0x66, 0x69, 0x65, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2754,105 +2895,108 @@ func file_resource_proto_rawDescGZIP() []byte { return file_resource_proto_rawDescData } -var file_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 6) +var file_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 31) var file_resource_proto_goTypes = []interface{}{ (ResourceOperation)(0), // 0: resource.ResourceOperation (ResourceVersionMatch)(0), // 1: resource.ResourceVersionMatch (LinkBlob_Action)(0), // 2: resource.LinkBlob.Action (Sort_Order)(0), // 3: resource.Sort.Order - (HealthCheckResponse_ServingStatus)(0), // 4: resource.HealthCheckResponse.ServingStatus - (*ResourceKey)(nil), // 5: resource.ResourceKey - (*ResourceWrapper)(nil), // 6: resource.ResourceWrapper - (*ResourceMeta)(nil), // 7: resource.ResourceMeta - (*BlobInfo)(nil), // 8: resource.BlobInfo - (*StatusResult)(nil), // 9: resource.StatusResult - (*LinkBlob)(nil), // 10: resource.LinkBlob - (*CreateRequest)(nil), // 11: resource.CreateRequest - (*CreateResponse)(nil), // 12: resource.CreateResponse - (*UpdateRequest)(nil), // 13: resource.UpdateRequest - (*UpdateResponse)(nil), // 14: resource.UpdateResponse - (*DeleteRequest)(nil), // 15: resource.DeleteRequest - (*DeleteResponse)(nil), // 16: resource.DeleteResponse - (*ReadRequest)(nil), // 17: resource.ReadRequest - (*ReadResponse)(nil), // 18: resource.ReadResponse - (*GetBlobRequest)(nil), // 19: resource.GetBlobRequest - (*GetBlobResponse)(nil), // 20: resource.GetBlobResponse - (*Requirement)(nil), // 21: resource.Requirement - (*Sort)(nil), // 22: resource.Sort - (*ListOptions)(nil), // 23: resource.ListOptions - (*ListRequest)(nil), // 24: resource.ListRequest - (*ListResponse)(nil), // 25: resource.ListResponse - (*WatchRequest)(nil), // 26: resource.WatchRequest - (*WatchResponse)(nil), // 27: resource.WatchResponse - (*HistoryRequest)(nil), // 28: resource.HistoryRequest - (*HistoryResponse)(nil), // 29: resource.HistoryResponse - (*OriginRequest)(nil), // 30: resource.OriginRequest - (*ResourceOriginInfo)(nil), // 31: resource.ResourceOriginInfo - (*OriginResponse)(nil), // 32: resource.OriginResponse - (*HealthCheckRequest)(nil), // 33: resource.HealthCheckRequest - (*HealthCheckResponse)(nil), // 34: resource.HealthCheckResponse + (WatchEvent_Type)(0), // 4: resource.WatchEvent.Type + (HealthCheckResponse_ServingStatus)(0), // 5: resource.HealthCheckResponse.ServingStatus + (*ResourceKey)(nil), // 6: resource.ResourceKey + (*ResourceWrapper)(nil), // 7: resource.ResourceWrapper + (*ResourceMeta)(nil), // 8: resource.ResourceMeta + (*BlobInfo)(nil), // 9: resource.BlobInfo + (*StatusResult)(nil), // 10: resource.StatusResult + (*LinkBlob)(nil), // 11: resource.LinkBlob + (*CreateRequest)(nil), // 12: resource.CreateRequest + (*CreateResponse)(nil), // 13: resource.CreateResponse + (*UpdateRequest)(nil), // 14: resource.UpdateRequest + (*UpdateResponse)(nil), // 15: resource.UpdateResponse + (*DeleteRequest)(nil), // 16: resource.DeleteRequest + (*DeleteResponse)(nil), // 17: resource.DeleteResponse + (*ReadRequest)(nil), // 18: resource.ReadRequest + (*ReadResponse)(nil), // 19: resource.ReadResponse + (*GetBlobRequest)(nil), // 20: resource.GetBlobRequest + (*GetBlobResponse)(nil), // 21: resource.GetBlobResponse + (*Requirement)(nil), // 22: resource.Requirement + (*Sort)(nil), // 23: resource.Sort + (*ListOptions)(nil), // 24: resource.ListOptions + (*ListRequest)(nil), // 25: resource.ListRequest + (*ListResponse)(nil), // 26: resource.ListResponse + (*WatchRequest)(nil), // 27: resource.WatchRequest + (*WatchEvent)(nil), // 28: resource.WatchEvent + (*HistoryRequest)(nil), // 29: resource.HistoryRequest + (*HistoryResponse)(nil), // 30: resource.HistoryResponse + (*OriginRequest)(nil), // 31: resource.OriginRequest + (*ResourceOriginInfo)(nil), // 32: resource.ResourceOriginInfo + (*OriginResponse)(nil), // 33: resource.OriginResponse + (*HealthCheckRequest)(nil), // 34: resource.HealthCheckRequest + (*HealthCheckResponse)(nil), // 35: resource.HealthCheckResponse + (*WatchEvent_Resource)(nil), // 36: resource.WatchEvent.Resource } var file_resource_proto_depIdxs = []int32{ 0, // 0: resource.ResourceWrapper.operation:type_name -> resource.ResourceOperation 0, // 1: resource.ResourceMeta.operation:type_name -> resource.ResourceOperation - 5, // 2: resource.CreateRequest.key:type_name -> resource.ResourceKey - 10, // 3: resource.CreateRequest.blob:type_name -> resource.LinkBlob - 9, // 4: resource.CreateResponse.status:type_name -> resource.StatusResult - 5, // 5: resource.UpdateRequest.key:type_name -> resource.ResourceKey - 10, // 6: resource.UpdateRequest.blob:type_name -> resource.LinkBlob - 9, // 7: resource.UpdateResponse.status:type_name -> resource.StatusResult - 5, // 8: resource.DeleteRequest.key:type_name -> resource.ResourceKey - 9, // 9: resource.DeleteResponse.status:type_name -> resource.StatusResult - 5, // 10: resource.ReadRequest.key:type_name -> resource.ResourceKey - 9, // 11: resource.ReadResponse.status:type_name -> resource.StatusResult - 5, // 12: resource.GetBlobRequest.key:type_name -> resource.ResourceKey - 9, // 13: resource.GetBlobResponse.status:type_name -> resource.StatusResult - 8, // 14: resource.GetBlobResponse.info:type_name -> resource.BlobInfo + 6, // 2: resource.CreateRequest.key:type_name -> resource.ResourceKey + 11, // 3: resource.CreateRequest.blob:type_name -> resource.LinkBlob + 10, // 4: resource.CreateResponse.status:type_name -> resource.StatusResult + 6, // 5: resource.UpdateRequest.key:type_name -> resource.ResourceKey + 11, // 6: resource.UpdateRequest.blob:type_name -> resource.LinkBlob + 10, // 7: resource.UpdateResponse.status:type_name -> resource.StatusResult + 6, // 8: resource.DeleteRequest.key:type_name -> resource.ResourceKey + 10, // 9: resource.DeleteResponse.status:type_name -> resource.StatusResult + 6, // 10: resource.ReadRequest.key:type_name -> resource.ResourceKey + 10, // 11: resource.ReadResponse.status:type_name -> resource.StatusResult + 6, // 12: resource.GetBlobRequest.key:type_name -> resource.ResourceKey + 10, // 13: resource.GetBlobResponse.status:type_name -> resource.StatusResult + 9, // 14: resource.GetBlobResponse.info:type_name -> resource.BlobInfo 3, // 15: resource.Sort.order:type_name -> resource.Sort.Order - 5, // 16: resource.ListOptions.key:type_name -> resource.ResourceKey - 21, // 17: resource.ListOptions.labels:type_name -> resource.Requirement - 21, // 18: resource.ListOptions.fields:type_name -> resource.Requirement + 6, // 16: resource.ListOptions.key:type_name -> resource.ResourceKey + 22, // 17: resource.ListOptions.labels:type_name -> resource.Requirement + 22, // 18: resource.ListOptions.fields:type_name -> resource.Requirement 1, // 19: resource.ListRequest.version_match:type_name -> resource.ResourceVersionMatch - 23, // 20: resource.ListRequest.options:type_name -> resource.ListOptions - 22, // 21: resource.ListRequest.sort:type_name -> resource.Sort - 6, // 22: resource.ListResponse.items:type_name -> resource.ResourceWrapper - 23, // 23: resource.WatchRequest.options:type_name -> resource.ListOptions - 6, // 24: resource.WatchResponse.resource:type_name -> resource.ResourceWrapper - 6, // 25: resource.WatchResponse.previous:type_name -> resource.ResourceWrapper - 5, // 26: resource.HistoryRequest.key:type_name -> resource.ResourceKey - 7, // 27: resource.HistoryResponse.items:type_name -> resource.ResourceMeta - 5, // 28: resource.OriginRequest.key:type_name -> resource.ResourceKey - 5, // 29: resource.ResourceOriginInfo.key:type_name -> resource.ResourceKey - 31, // 30: resource.OriginResponse.items:type_name -> resource.ResourceOriginInfo - 4, // 31: resource.HealthCheckResponse.status:type_name -> resource.HealthCheckResponse.ServingStatus - 17, // 32: resource.ResourceStore.Read:input_type -> resource.ReadRequest - 11, // 33: resource.ResourceStore.Create:input_type -> resource.CreateRequest - 13, // 34: resource.ResourceStore.Update:input_type -> resource.UpdateRequest - 15, // 35: resource.ResourceStore.Delete:input_type -> resource.DeleteRequest - 24, // 36: resource.ResourceStore.List:input_type -> resource.ListRequest - 26, // 37: resource.ResourceStore.Watch:input_type -> resource.WatchRequest - 17, // 38: resource.ResourceSearch.Read:input_type -> resource.ReadRequest - 19, // 39: resource.ResourceSearch.GetBlob:input_type -> resource.GetBlobRequest - 28, // 40: resource.ResourceSearch.History:input_type -> resource.HistoryRequest - 30, // 41: resource.ResourceSearch.Origin:input_type -> resource.OriginRequest - 33, // 42: resource.Diagnostics.IsHealthy:input_type -> resource.HealthCheckRequest - 18, // 43: resource.ResourceStore.Read:output_type -> resource.ReadResponse - 12, // 44: resource.ResourceStore.Create:output_type -> resource.CreateResponse - 14, // 45: resource.ResourceStore.Update:output_type -> resource.UpdateResponse - 16, // 46: resource.ResourceStore.Delete:output_type -> resource.DeleteResponse - 25, // 47: resource.ResourceStore.List:output_type -> resource.ListResponse - 27, // 48: resource.ResourceStore.Watch:output_type -> resource.WatchResponse - 18, // 49: resource.ResourceSearch.Read:output_type -> resource.ReadResponse - 20, // 50: resource.ResourceSearch.GetBlob:output_type -> resource.GetBlobResponse - 29, // 51: resource.ResourceSearch.History:output_type -> resource.HistoryResponse - 32, // 52: resource.ResourceSearch.Origin:output_type -> resource.OriginResponse - 34, // 53: resource.Diagnostics.IsHealthy:output_type -> resource.HealthCheckResponse - 43, // [43:54] is the sub-list for method output_type - 32, // [32:43] is the sub-list for method input_type - 32, // [32:32] is the sub-list for extension type_name - 32, // [32:32] is the sub-list for extension extendee - 0, // [0:32] is the sub-list for field type_name + 24, // 20: resource.ListRequest.options:type_name -> resource.ListOptions + 23, // 21: resource.ListRequest.sort:type_name -> resource.Sort + 7, // 22: resource.ListResponse.items:type_name -> resource.ResourceWrapper + 24, // 23: resource.WatchRequest.options:type_name -> resource.ListOptions + 4, // 24: resource.WatchEvent.type:type_name -> resource.WatchEvent.Type + 36, // 25: resource.WatchEvent.resource:type_name -> resource.WatchEvent.Resource + 36, // 26: resource.WatchEvent.previous:type_name -> resource.WatchEvent.Resource + 6, // 27: resource.HistoryRequest.key:type_name -> resource.ResourceKey + 8, // 28: resource.HistoryResponse.items:type_name -> resource.ResourceMeta + 6, // 29: resource.OriginRequest.key:type_name -> resource.ResourceKey + 6, // 30: resource.ResourceOriginInfo.key:type_name -> resource.ResourceKey + 32, // 31: resource.OriginResponse.items:type_name -> resource.ResourceOriginInfo + 5, // 32: resource.HealthCheckResponse.status:type_name -> resource.HealthCheckResponse.ServingStatus + 18, // 33: resource.ResourceStore.Read:input_type -> resource.ReadRequest + 12, // 34: resource.ResourceStore.Create:input_type -> resource.CreateRequest + 14, // 35: resource.ResourceStore.Update:input_type -> resource.UpdateRequest + 16, // 36: resource.ResourceStore.Delete:input_type -> resource.DeleteRequest + 25, // 37: resource.ResourceStore.List:input_type -> resource.ListRequest + 27, // 38: resource.ResourceStore.Watch:input_type -> resource.WatchRequest + 18, // 39: resource.ResourceSearch.Read:input_type -> resource.ReadRequest + 20, // 40: resource.ResourceSearch.GetBlob:input_type -> resource.GetBlobRequest + 29, // 41: resource.ResourceSearch.History:input_type -> resource.HistoryRequest + 31, // 42: resource.ResourceSearch.Origin:input_type -> resource.OriginRequest + 34, // 43: resource.Diagnostics.IsHealthy:input_type -> resource.HealthCheckRequest + 19, // 44: resource.ResourceStore.Read:output_type -> resource.ReadResponse + 13, // 45: resource.ResourceStore.Create:output_type -> resource.CreateResponse + 15, // 46: resource.ResourceStore.Update:output_type -> resource.UpdateResponse + 17, // 47: resource.ResourceStore.Delete:output_type -> resource.DeleteResponse + 26, // 48: resource.ResourceStore.List:output_type -> resource.ListResponse + 28, // 49: resource.ResourceStore.Watch:output_type -> resource.WatchEvent + 19, // 50: resource.ResourceSearch.Read:output_type -> resource.ReadResponse + 21, // 51: resource.ResourceSearch.GetBlob:output_type -> resource.GetBlobResponse + 30, // 52: resource.ResourceSearch.History:output_type -> resource.HistoryResponse + 33, // 53: resource.ResourceSearch.Origin:output_type -> resource.OriginResponse + 35, // 54: resource.Diagnostics.IsHealthy:output_type -> resource.HealthCheckResponse + 44, // [44:55] is the sub-list for method output_type + 33, // [33:44] is the sub-list for method input_type + 33, // [33:33] is the sub-list for extension type_name + 33, // [33:33] is the sub-list for extension extendee + 0, // [0:33] is the sub-list for field type_name } func init() { file_resource_proto_init() } @@ -3126,7 +3270,7 @@ func file_resource_proto_init() { } } file_resource_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WatchResponse); i { + switch v := v.(*WatchEvent); i { case 0: return &v.state case 1: @@ -3221,14 +3365,26 @@ func file_resource_proto_init() { return nil } } + file_resource_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WatchEvent_Resource); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_resource_proto_rawDesc, - NumEnums: 5, - NumMessages: 30, + NumEnums: 6, + NumMessages: 31, NumExtensions: 0, NumServices: 3, }, diff --git a/pkg/storage/unified/resource/resource.proto b/pkg/storage/unified/resource/resource.proto index 6f73c7d2403..81e9411c862 100644 --- a/pkg/storage/unified/resource/resource.proto +++ b/pkg/storage/unified/resource/resource.proto @@ -19,7 +19,6 @@ enum ResourceOperation { CREATED = 1; UPDATED = 2; DELETED = 3; - BOOKMARK = 4; } message ResourceWrapper { @@ -331,15 +330,35 @@ message WatchRequest { bool allow_watch_bookmarks = 5; } -message WatchResponse { +message WatchEvent { + enum Type { + UNKNOWN = 0; + ADDED = 1; + MODIFIED = 2; + DELETED = 3; + BOOKMARK = 4; + ERROR = 5; + } + + message Resource { + int64 version = 1; + bytes value = 2; + } + // Timestamp the event was sent int64 timestamp = 1; - // Entity that was created, updated, or deleted - ResourceWrapper resource = 2; + // Timestamp the event was sent + Type type = 2; - // previous version of the entity (in update+delete events) - ResourceWrapper previous = 3; + // Resource version for the object + Resource resource = 3; + + // Previous resource version (for update+delete) + Resource previous = 4; + + // The commit message that triggered this change + string message = 5; } message HistoryRequest { @@ -437,7 +456,7 @@ service ResourceStore { rpc Update(UpdateRequest) returns (UpdateResponse); rpc Delete(DeleteRequest) returns (DeleteResponse); rpc List(ListRequest) returns (ListResponse); - rpc Watch(WatchRequest) returns (stream WatchResponse); + rpc Watch(WatchRequest) returns (stream WatchEvent); } // Clients can use this service directly diff --git a/pkg/storage/unified/resource/resource_grpc.pb.go b/pkg/storage/unified/resource/resource_grpc.pb.go index bde23327064..ec22fb995da 100644 --- a/pkg/storage/unified/resource/resource_grpc.pb.go +++ b/pkg/storage/unified/resource/resource_grpc.pb.go @@ -119,7 +119,7 @@ func (c *resourceStoreClient) Watch(ctx context.Context, in *WatchRequest, opts } type ResourceStore_WatchClient interface { - Recv() (*WatchResponse, error) + Recv() (*WatchEvent, error) grpc.ClientStream } @@ -127,8 +127,8 @@ type resourceStoreWatchClient struct { grpc.ClientStream } -func (x *resourceStoreWatchClient) Recv() (*WatchResponse, error) { - m := new(WatchResponse) +func (x *resourceStoreWatchClient) Recv() (*WatchEvent, error) { + m := new(WatchEvent) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } @@ -285,7 +285,7 @@ func _ResourceStore_Watch_Handler(srv interface{}, stream grpc.ServerStream) err } type ResourceStore_WatchServer interface { - Send(*WatchResponse) error + Send(*WatchEvent) error grpc.ServerStream } @@ -293,7 +293,7 @@ type resourceStoreWatchServer struct { grpc.ServerStream } -func (x *resourceStoreWatchServer) Send(m *WatchResponse) error { +func (x *resourceStoreWatchServer) Send(m *WatchEvent) error { return x.ServerStream.SendMsg(m) } diff --git a/pkg/storage/unified/resource/server.go b/pkg/storage/unified/resource/server.go index 124a19de398..b4808b342d8 100644 --- a/pkg/storage/unified/resource/server.go +++ b/pkg/storage/unified/resource/server.go @@ -50,7 +50,7 @@ type AppendingStore interface { List(context.Context, *ListRequest) (*ListResponse, error) // Watch for events - Watch(context.Context, *WatchRequest) (chan *WatchResponse, error) + Watch(context.Context, *WatchRequest) (chan *WatchEvent, error) } type ResourceServerOptions struct { @@ -101,10 +101,10 @@ func NewResourceServer(opts ResourceServerOptions) (ResourceServer, error) { return nil, fmt.Errorf("missing AppendingStore implementation") } if opts.Search == nil { - opts.Search = &NoopServer{} + opts.Search = &noopService{} } if opts.Diagnostics == nil { - opts.Search = &NoopServer{} + opts.Search = &noopService{} } return &server{ diff --git a/pkg/storage/unified/sqlstash/sql_storage_server.go b/pkg/storage/unified/sqlstash/sql_storage_server.go index 5f4a5d0fc16..ff05bb02b5b 100644 --- a/pkg/storage/unified/sqlstash/sql_storage_server.go +++ b/pkg/storage/unified/sqlstash/sql_storage_server.go @@ -53,10 +53,10 @@ type sqlResourceStore struct { db db.EntityDBInterface // needed to keep xorm engine in scope sess *session.SessionDB dialect migrator.Dialect - broadcaster sqlstash.Broadcaster[*resource.WatchResponse] + broadcaster sqlstash.Broadcaster[*resource.WatchEvent] ctx context.Context // TODO: remove cancel context.CancelFunc - stream chan *resource.WatchResponse + stream chan *resource.WatchEvent tracer trace.Tracer sqlDB db.DB @@ -110,7 +110,7 @@ func (s *sqlResourceStore) Init() error { s.dialect = migrator.NewDialect(engine.DriverName()) // set up the broadcaster - s.broadcaster, err = sqlstash.NewBroadcaster(s.ctx, func(stream chan *resource.WatchResponse) error { + s.broadcaster, err = sqlstash.NewBroadcaster(s.ctx, func(stream chan *resource.WatchEvent) error { s.stream = stream // start the poller diff --git a/pkg/storage/unified/sqlstash/watch.go b/pkg/storage/unified/sqlstash/watch.go index 2c48a1992f8..8dfcdb4d5ee 100644 --- a/pkg/storage/unified/sqlstash/watch.go +++ b/pkg/storage/unified/sqlstash/watch.go @@ -8,11 +8,11 @@ import ( "github.com/grafana/grafana/pkg/storage/unified/resource" ) -func (s *sqlResourceStore) Watch(context.Context, *resource.WatchRequest) (chan *resource.WatchResponse, error) { +func (s *sqlResourceStore) Watch(context.Context, *resource.WatchRequest) (chan *resource.WatchEvent, error) { return nil, ErrNotImplementedYet } -func (s *sqlResourceStore) poller(stream chan *resource.WatchResponse) { +func (s *sqlResourceStore) poller(stream chan *resource.WatchEvent) { var err error since := int64(0) @@ -35,7 +35,7 @@ func (s *sqlResourceStore) poller(stream chan *resource.WatchResponse) { } } -func (s *sqlResourceStore) poll(since int64, out chan *resource.WatchResponse) (int64, error) { +func (s *sqlResourceStore) poll(since int64, out chan *resource.WatchEvent) (int64, error) { ctx, span := s.tracer.Start(s.ctx, "storage_server.poll") defer span.End() ctxLogger := s.log.FromContext(log.WithContextualAttributes(ctx, []any{"method", "poll"})) @@ -44,7 +44,7 @@ func (s *sqlResourceStore) poll(since int64, out chan *resource.WatchResponse) ( err := func() error { if false { // TODO - out <- &resource.WatchResponse{} + out <- &resource.WatchEvent{} } // TODO, copy from entity store