From 85a207fcebb5acffe6474b97fef91f611f1989ee Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Thu, 31 Aug 2023 15:43:35 -0400 Subject: [PATCH] Chore: Replace entity GRN with infra/grn GRN (#74198) replace entity GRN with infra/grn GRN --- Makefile | 3 + pkg/infra/grn/generate.sh | 24 + pkg/infra/grn/grn.go | 43 +- pkg/infra/grn/grn.pb.go | 172 ++++ pkg/infra/grn/grn.proto | 20 + pkg/infra/grn/grn_test.go | 24 +- .../pluginextensionv2/rendererv2.pb.go | 9 +- .../pluginextensionv2/sanitizer.pb.go | 19 +- .../secretsmanagerplugin/generate.sh | 17 +- .../secretsmanagerplugin/secretsmanager.pb.go | 39 +- .../secretsmanager_grpc.pb.go | 62 +- .../playlist/playlistimpl/entity_store.go | 35 +- pkg/services/store/entity/entity.pb.go | 961 ++++++++---------- pkg/services/store/entity/entity.proto | 37 +- pkg/services/store/entity/entity_grpc.pb.go | 88 +- pkg/services/store/entity/generate.sh | 15 +- pkg/services/store/entity/grn.go | 21 - .../store/entity/httpentitystore/service.go | 21 +- pkg/services/store/entity/json.go | 4 +- pkg/services/store/entity/json_test.go | 12 +- .../store/entity/sqlstash/folder_support.go | 5 +- .../entity/sqlstash/sql_storage_server.go | 85 +- .../store/entity/sqlstash/summary_handler.go | 3 +- .../entity/tests/server_integration_test.go | 107 +- 24 files changed, 983 insertions(+), 843 deletions(-) create mode 100755 pkg/infra/grn/generate.sh create mode 100644 pkg/infra/grn/grn.pb.go create mode 100644 pkg/infra/grn/grn.proto delete mode 100644 pkg/services/store/entity/grn.go diff --git a/Makefile b/Makefile index 5db0e4c028f..a6b123eefe6 100644 --- a/Makefile +++ b/Makefile @@ -263,6 +263,9 @@ devenv-mysql: protobuf: ## Compile protobuf definitions bash scripts/protobuf-check.sh bash pkg/plugins/backendplugin/pluginextensionv2/generate.sh + bash pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh + bash pkg/services/store/entity/generate.sh + bash pkg/infra/grn/generate.sh clean: ## Clean up intermediate build artifacts. @echo "cleaning" diff --git a/pkg/infra/grn/generate.sh b/pkg/infra/grn/generate.sh new file mode 100755 index 00000000000..849ac461b54 --- /dev/null +++ b/pkg/infra/grn/generate.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# To compile all protobuf files in this repository, run +# "make protobuf" at the top-level. + +set -eu + +DST_DIR=./ + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd "$DIR" + +protoc \ + -I ./ \ + -I ../../../ \ + --go_out=${DST_DIR} \ + --go_opt=paths=source_relative \ + --go-grpc_out=${DST_DIR} \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + *.proto diff --git a/pkg/infra/grn/grn.go b/pkg/infra/grn/grn.go index 6551b6c8b9d..a2d2cfb8f6b 100644 --- a/pkg/infra/grn/grn.go +++ b/pkg/infra/grn/grn.go @@ -6,32 +6,10 @@ import ( "strings" ) -// Grafana resource name. See also: -// https://github.com/grafana/grafana/blob/main/pkg/services/store/entity/entity.proto#L6 -// NOTE: This structure/format is still under active development and is subject to change -type GRN struct { - // TenantID contains the ID of the tenant (in hosted grafana) or - // organization (in other environments) the resource belongs to. This field - // may be omitted for global Grafana resources which are not associated with - // an organization. - TenantID int64 - - // The kind of resource being identified, for e.g. "dashboard" or "user". - // The caller is responsible for validating the value. - ResourceKind string - - // ResourceIdentifier is used by the underlying service to identify the - // resource. - ResourceIdentifier string - - // GRN can not be extended - _ any -} - // ParseStr attempts to parse a string into a GRN. It returns an error if the // given string does not match the GRN format, but does not validate the values. -func ParseStr(str string) (GRN, error) { - ret := GRN{} +func ParseStr(str string) (*GRN, error) { + ret := &GRN{} parts := strings.Split(str, ":") if len(parts) != 3 { @@ -65,7 +43,7 @@ func ParseStr(str string) (GRN, error) { // MustParseStr is a wrapper around ParseStr that panics if the given input is // not a valid GRN. This is intended for use in tests. -func MustParseStr(str string) GRN { +func MustParseStr(str string) *GRN { grn, err := ParseStr(str) if err != nil { panic("bad grn!") @@ -73,8 +51,19 @@ func MustParseStr(str string) GRN { return grn } -// String returns a string representation of a grn in the format +// ToGRNString returns a string representation of a grn in the format // grn:tenantID:kind/resourceIdentifier -func (g *GRN) String() string { +func (g *GRN) ToGRNString() string { return fmt.Sprintf("grn:%d:%s/%s", g.TenantID, g.ResourceKind, g.ResourceIdentifier) } + +// Check if the two GRNs reference to the same object +// we can not use simple `*x == *b` because of the internal settings +func (g *GRN) Equal(b *GRN) bool { + if b == nil { + return false + } + return g == b || (g.TenantID == b.TenantID && + g.ResourceKind == b.ResourceKind && + g.ResourceIdentifier == b.ResourceIdentifier) +} diff --git a/pkg/infra/grn/grn.pb.go b/pkg/infra/grn/grn.pb.go new file mode 100644 index 00000000000..bc551198897 --- /dev/null +++ b/pkg/infra/grn/grn.pb.go @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: grn.proto + +package grn + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GRN struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // TenantID contains the ID of the tenant (in hosted grafana) or + // organization (in other environments) the resource belongs to. This field + // may be omitted for global Grafana resources which are not associated with + // an organization. + TenantID int64 `protobuf:"varint,1,opt,name=TenantID,proto3" json:"TenantID,omitempty"` + // The kind of resource being identified, for e.g. "dashboard" or "user". + // The caller is responsible for validating the value. + ResourceKind string `protobuf:"bytes,3,opt,name=ResourceKind,proto3" json:"ResourceKind,omitempty"` + // ResourceIdentifier is used by the underlying service to identify the + // resource. + ResourceIdentifier string `protobuf:"bytes,4,opt,name=ResourceIdentifier,proto3" json:"ResourceIdentifier,omitempty"` +} + +func (x *GRN) Reset() { + *x = GRN{} + if protoimpl.UnsafeEnabled { + mi := &file_grn_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GRN) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GRN) ProtoMessage() {} + +func (x *GRN) ProtoReflect() protoreflect.Message { + mi := &file_grn_proto_msgTypes[0] + 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 GRN.ProtoReflect.Descriptor instead. +func (*GRN) Descriptor() ([]byte, []int) { + return file_grn_proto_rawDescGZIP(), []int{0} +} + +func (x *GRN) GetTenantID() int64 { + if x != nil { + return x.TenantID + } + return 0 +} + +func (x *GRN) GetResourceKind() string { + if x != nil { + return x.ResourceKind + } + return "" +} + +func (x *GRN) GetResourceIdentifier() string { + if x != nil { + return x.ResourceIdentifier + } + return "" +} + +var File_grn_proto protoreflect.FileDescriptor + +var file_grn_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x67, 0x72, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x67, 0x72, 0x6e, + 0x22, 0x75, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x54, 0x65, 0x6e, 0x61, 0x6e, + 0x74, 0x49, 0x44, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4b, + 0x69, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x12, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x42, 0x2a, 0x5a, 0x28, 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, 0x69, 0x6e, 0x66, 0x72, 0x61, 0x2f, + 0x67, 0x72, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_grn_proto_rawDescOnce sync.Once + file_grn_proto_rawDescData = file_grn_proto_rawDesc +) + +func file_grn_proto_rawDescGZIP() []byte { + file_grn_proto_rawDescOnce.Do(func() { + file_grn_proto_rawDescData = protoimpl.X.CompressGZIP(file_grn_proto_rawDescData) + }) + return file_grn_proto_rawDescData +} + +var file_grn_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_grn_proto_goTypes = []interface{}{ + (*GRN)(nil), // 0: grn.GRN +} +var file_grn_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_grn_proto_init() } +func file_grn_proto_init() { + if File_grn_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_grn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GRN); 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_grn_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_grn_proto_goTypes, + DependencyIndexes: file_grn_proto_depIdxs, + MessageInfos: file_grn_proto_msgTypes, + }.Build() + File_grn_proto = out.File + file_grn_proto_rawDesc = nil + file_grn_proto_goTypes = nil + file_grn_proto_depIdxs = nil +} diff --git a/pkg/infra/grn/grn.proto b/pkg/infra/grn/grn.proto new file mode 100644 index 00000000000..45a8bce4ffc --- /dev/null +++ b/pkg/infra/grn/grn.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package grn; + +option go_package = "github.com/grafana/grafana/pkg/infra/grn"; + +message GRN { + // TenantID contains the ID of the tenant (in hosted grafana) or + // organization (in other environments) the resource belongs to. This field + // may be omitted for global Grafana resources which are not associated with + // an organization. + int64 TenantID = 1; + + // The kind of resource being identified, for e.g. "dashboard" or "user". + // The caller is responsible for validating the value. + string ResourceKind = 3; + + // ResourceIdentifier is used by the underlying service to identify the + // resource. + string ResourceIdentifier = 4; +} diff --git a/pkg/infra/grn/grn_test.go b/pkg/infra/grn/grn_test.go index b6aeee164c2..a9be304083d 100644 --- a/pkg/infra/grn/grn_test.go +++ b/pkg/infra/grn/grn_test.go @@ -3,57 +3,59 @@ package grn import ( "fmt" "testing" + + "github.com/google/go-cmp/cmp" ) func TestParseGRNStr(t *testing.T) { tests := []struct { input string - expect GRN + expect *GRN expectErr bool }{ { // empty "", - GRN{}, + &GRN{}, true, }, { // too few parts "grn:dashboards", - GRN{}, + &GRN{}, true, }, { // too many parts "grn::dashboards:user:orgs:otherthings:hello:stillgoing", - GRN{}, + &GRN{}, true, }, { // Does not look like a GRN "hrn:grafana::123:dashboards/foo", - GRN{}, + &GRN{}, true, }, { // Missing Kind "grn::foo", - GRN{}, + &GRN{}, true, }, { // good! "grn::roles/Admin", - GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "Admin"}, + &GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "Admin"}, false, }, { // good! "grn::roles/Admin/with/some/slashes", - GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "Admin/with/some/slashes"}, + &GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "Admin/with/some/slashes"}, false, }, { // good! "grn:123456789:roles/Admin/with/some/slashes", - GRN{TenantID: 123456789, ResourceKind: "roles", ResourceIdentifier: "Admin/with/some/slashes"}, + &GRN{TenantID: 123456789, ResourceKind: "roles", ResourceIdentifier: "Admin/with/some/slashes"}, false, }, { // Weird, but valid. "grn::roles///Admin/with/leading/slashes", - GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "//Admin/with/leading/slashes"}, + &GRN{TenantID: 0, ResourceKind: "roles", ResourceIdentifier: "//Admin/with/leading/slashes"}, false, }, } @@ -69,7 +71,7 @@ func TestParseGRNStr(t *testing.T) { t.Fatalf("wrong result. Expected success, got error %s", err.Error()) } - if got != test.expect { + if !cmp.Equal(test.expect, got) { t.Fatalf("wrong result. Wanted %s, got %s\n", test.expect.String(), got.String()) } }) diff --git a/pkg/plugins/backendplugin/pluginextensionv2/rendererv2.pb.go b/pkg/plugins/backendplugin/pluginextensionv2/rendererv2.pb.go index b7b11c11025..b2e563a112d 100644 --- a/pkg/plugins/backendplugin/pluginextensionv2/rendererv2.pb.go +++ b/pkg/plugins/backendplugin/pluginextensionv2/rendererv2.pb.go @@ -1,21 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 -// protoc v3.21.4 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: rendererv2.proto package pluginextensionv2 import ( context "context" - reflect "reflect" - sync "sync" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( diff --git a/pkg/plugins/backendplugin/pluginextensionv2/sanitizer.pb.go b/pkg/plugins/backendplugin/pluginextensionv2/sanitizer.pb.go index 171fba64e1b..8fceddd4189 100644 --- a/pkg/plugins/backendplugin/pluginextensionv2/sanitizer.pb.go +++ b/pkg/plugins/backendplugin/pluginextensionv2/sanitizer.pb.go @@ -1,21 +1,20 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: sanitizer.proto package pluginextensionv2 import ( context "context" - reflect "reflect" - sync "sync" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -192,7 +191,7 @@ func file_sanitizer_proto_rawDescGZIP() []byte { } var file_sanitizer_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_sanitizer_proto_goTypes = []any{ +var file_sanitizer_proto_goTypes = []interface{}{ (*SanitizeRequest)(nil), // 0: pluginextensionv2.SanitizeRequest (*SanitizeResponse)(nil), // 1: pluginextensionv2.SanitizeResponse } @@ -212,7 +211,7 @@ func file_sanitizer_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_sanitizer_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_sanitizer_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SanitizeRequest); i { case 0: return &v.state @@ -224,7 +223,7 @@ func file_sanitizer_proto_init() { return nil } } - file_sanitizer_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_sanitizer_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SanitizeResponse); i { case 0: return &v.state @@ -306,7 +305,7 @@ func RegisterSanitizerServer(s *grpc.Server, srv SanitizerServer) { s.RegisterService(&_Sanitizer_serviceDesc, srv) } -func _Sanitizer_Sanitize_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Sanitizer_Sanitize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SanitizeRequest) if err := dec(in); err != nil { return nil, err @@ -318,7 +317,7 @@ func _Sanitizer_Sanitize_Handler(srv any, ctx context.Context, dec func(any) err Server: srv, FullMethod: "/pluginextensionv2.Sanitizer/Sanitize", } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SanitizerServer).Sanitize(ctx, req.(*SanitizeRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh b/pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh index 2da8cabab71..f7b855eaf29 100755 --- a/pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh +++ b/pkg/plugins/backendplugin/secretsmanagerplugin/generate.sh @@ -1,3 +1,18 @@ +#!/bin/bash + +# To compile all protobuf files in this repository, run +# "make protobuf" at the top-level. + +set -eu + +DST_DIR=../genproto/pluginv2 + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +cd "$DIR" + protoc --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=paths=source_relative \ - secretsmanager.proto \ No newline at end of file + *.proto \ No newline at end of file diff --git a/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager.pb.go b/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager.pb.go index f6d3dc233b4..79834373e01 100644 --- a/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager.pb.go +++ b/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager.pb.go @@ -1,17 +1,16 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: secretsmanager.proto package secretsmanagerplugin import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -893,7 +892,7 @@ func file_secretsmanager_proto_rawDescGZIP() []byte { } var file_secretsmanager_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_secretsmanager_proto_goTypes = []any{ +var file_secretsmanager_proto_goTypes = []interface{}{ (*Key)(nil), // 0: secretsmanagerplugin.Key (*Item)(nil), // 1: secretsmanagerplugin.Item (*GetSecretRequest)(nil), // 2: secretsmanagerplugin.GetSecretRequest @@ -943,7 +942,7 @@ func file_secretsmanager_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_secretsmanager_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Key); i { case 0: return &v.state @@ -955,7 +954,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Item); i { case 0: return &v.state @@ -967,7 +966,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSecretRequest); i { case 0: return &v.state @@ -979,7 +978,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSecretResponse); i { case 0: return &v.state @@ -991,7 +990,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetSecretRequest); i { case 0: return &v.state @@ -1003,7 +1002,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetSecretResponse); i { case 0: return &v.state @@ -1015,7 +1014,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteSecretRequest); i { case 0: return &v.state @@ -1027,7 +1026,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteSecretResponse); i { case 0: return &v.state @@ -1039,7 +1038,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListSecretsRequest); i { case 0: return &v.state @@ -1051,7 +1050,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListSecretsResponse); i { case 0: return &v.state @@ -1063,7 +1062,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAllSecretsRequest); i { case 0: return &v.state @@ -1075,7 +1074,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetAllSecretsResponse); i { case 0: return &v.state @@ -1087,7 +1086,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RenameSecretRequest); i { case 0: return &v.state @@ -1099,7 +1098,7 @@ func file_secretsmanager_proto_init() { return nil } } - file_secretsmanager_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_secretsmanager_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RenameSecretResponse); i { case 0: return &v.state diff --git a/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager_grpc.pb.go b/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager_grpc.pb.go index 6d073e4ccd5..466b8f9b6a0 100644 --- a/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager_grpc.pb.go +++ b/pkg/plugins/backendplugin/secretsmanagerplugin/secretsmanager_grpc.pb.go @@ -1,14 +1,13 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.19.4 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.4 // source: secretsmanager.proto package secretsmanagerplugin import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -19,6 +18,15 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + SecretsManager_GetSecret_FullMethodName = "/secretsmanagerplugin.SecretsManager/GetSecret" + SecretsManager_SetSecret_FullMethodName = "/secretsmanagerplugin.SecretsManager/SetSecret" + SecretsManager_DeleteSecret_FullMethodName = "/secretsmanagerplugin.SecretsManager/DeleteSecret" + SecretsManager_ListSecrets_FullMethodName = "/secretsmanagerplugin.SecretsManager/ListSecrets" + SecretsManager_RenameSecret_FullMethodName = "/secretsmanagerplugin.SecretsManager/RenameSecret" + SecretsManager_GetAllSecrets_FullMethodName = "/secretsmanagerplugin.SecretsManager/GetAllSecrets" +) + // SecretsManagerClient is the client API for SecretsManager service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -41,7 +49,7 @@ func NewSecretsManagerClient(cc grpc.ClientConnInterface) SecretsManagerClient { func (c *secretsManagerClient) GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) { out := new(GetSecretResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/GetSecret", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_GetSecret_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -50,7 +58,7 @@ func (c *secretsManagerClient) GetSecret(ctx context.Context, in *GetSecretReque func (c *secretsManagerClient) SetSecret(ctx context.Context, in *SetSecretRequest, opts ...grpc.CallOption) (*SetSecretResponse, error) { out := new(SetSecretResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/SetSecret", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_SetSecret_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -59,7 +67,7 @@ func (c *secretsManagerClient) SetSecret(ctx context.Context, in *SetSecretReque func (c *secretsManagerClient) DeleteSecret(ctx context.Context, in *DeleteSecretRequest, opts ...grpc.CallOption) (*DeleteSecretResponse, error) { out := new(DeleteSecretResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/DeleteSecret", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_DeleteSecret_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -68,7 +76,7 @@ func (c *secretsManagerClient) DeleteSecret(ctx context.Context, in *DeleteSecre func (c *secretsManagerClient) ListSecrets(ctx context.Context, in *ListSecretsRequest, opts ...grpc.CallOption) (*ListSecretsResponse, error) { out := new(ListSecretsResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/ListSecrets", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_ListSecrets_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,7 +85,7 @@ func (c *secretsManagerClient) ListSecrets(ctx context.Context, in *ListSecretsR func (c *secretsManagerClient) RenameSecret(ctx context.Context, in *RenameSecretRequest, opts ...grpc.CallOption) (*RenameSecretResponse, error) { out := new(RenameSecretResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/RenameSecret", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_RenameSecret_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -86,7 +94,7 @@ func (c *secretsManagerClient) RenameSecret(ctx context.Context, in *RenameSecre func (c *secretsManagerClient) GetAllSecrets(ctx context.Context, in *GetAllSecretsRequest, opts ...grpc.CallOption) (*GetAllSecretsResponse, error) { out := new(GetAllSecretsResponse) - err := c.cc.Invoke(ctx, "/secretsmanagerplugin.SecretsManager/GetAllSecrets", in, out, opts...) + err := c.cc.Invoke(ctx, SecretsManager_GetAllSecrets_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -141,7 +149,7 @@ func RegisterSecretsManagerServer(s grpc.ServiceRegistrar, srv SecretsManagerSer s.RegisterService(&SecretsManager_ServiceDesc, srv) } -func _SecretsManager_GetSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetSecretRequest) if err := dec(in); err != nil { return nil, err @@ -151,15 +159,15 @@ func _SecretsManager_GetSecret_Handler(srv any, ctx context.Context, dec func(an } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/GetSecret", + FullMethod: SecretsManager_GetSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).GetSecret(ctx, req.(*GetSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _SecretsManager_SetSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_SetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetSecretRequest) if err := dec(in); err != nil { return nil, err @@ -169,15 +177,15 @@ func _SecretsManager_SetSecret_Handler(srv any, ctx context.Context, dec func(an } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/SetSecret", + FullMethod: SecretsManager_SetSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).SetSecret(ctx, req.(*SetSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _SecretsManager_DeleteSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_DeleteSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteSecretRequest) if err := dec(in); err != nil { return nil, err @@ -187,15 +195,15 @@ func _SecretsManager_DeleteSecret_Handler(srv any, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/DeleteSecret", + FullMethod: SecretsManager_DeleteSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).DeleteSecret(ctx, req.(*DeleteSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _SecretsManager_ListSecrets_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_ListSecrets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListSecretsRequest) if err := dec(in); err != nil { return nil, err @@ -205,15 +213,15 @@ func _SecretsManager_ListSecrets_Handler(srv any, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/ListSecrets", + FullMethod: SecretsManager_ListSecrets_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).ListSecrets(ctx, req.(*ListSecretsRequest)) } return interceptor(ctx, in, info, handler) } -func _SecretsManager_RenameSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_RenameSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RenameSecretRequest) if err := dec(in); err != nil { return nil, err @@ -223,15 +231,15 @@ func _SecretsManager_RenameSecret_Handler(srv any, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/RenameSecret", + FullMethod: SecretsManager_RenameSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).RenameSecret(ctx, req.(*RenameSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _SecretsManager_GetAllSecrets_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _SecretsManager_GetAllSecrets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetAllSecretsRequest) if err := dec(in); err != nil { return nil, err @@ -241,9 +249,9 @@ func _SecretsManager_GetAllSecrets_Handler(srv any, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/secretsmanagerplugin.SecretsManager/GetAllSecrets", + FullMethod: SecretsManager_GetAllSecrets_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SecretsManagerServer).GetAllSecrets(ctx, req.(*GetAllSecretsRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/services/playlist/playlistimpl/entity_store.go b/pkg/services/playlist/playlistimpl/entity_store.go index d341994d817..0f1ff1da7a5 100644 --- a/pkg/services/playlist/playlistimpl/entity_store.go +++ b/pkg/services/playlist/playlistimpl/entity_store.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/grafana/grafana/pkg/infra/appcontext" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/services/playlist" "github.com/grafana/grafana/pkg/services/sqlstore/session" "github.com/grafana/grafana/pkg/services/store/entity" @@ -55,10 +56,10 @@ func (s *entityStoreImpl) sync() { } body, _ := json.Marshal(dto) _, _ = s.store.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - TenantId: info.OrgID, - UID: info.UID, - Kind: entity.StandardKindPlaylist, + GRN: &grn.GRN{ + TenantID: info.OrgID, + ResourceIdentifier: info.UID, + ResourceKind: entity.StandardKindPlaylist, }, Body: body, }) @@ -73,9 +74,9 @@ func (s *entityStoreImpl) Create(ctx context.Context, cmd *playlist.CreatePlayli return rsp, fmt.Errorf("unable to write playlist to store") } _, err = s.store.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - Kind: entity.StandardKindPlaylist, - UID: rsp.UID, + GRN: &grn.GRN{ + ResourceKind: entity.StandardKindPlaylist, + ResourceIdentifier: rsp.UID, }, Body: body, }) @@ -94,9 +95,9 @@ func (s *entityStoreImpl) Update(ctx context.Context, cmd *playlist.UpdatePlayli return rsp, fmt.Errorf("unable to write playlist to store") } _, err = s.store.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - UID: rsp.Uid, - Kind: entity.StandardKindPlaylist, + GRN: &grn.GRN{ + ResourceIdentifier: rsp.Uid, + ResourceKind: entity.StandardKindPlaylist, }, Body: body, }) @@ -111,9 +112,9 @@ func (s *entityStoreImpl) Delete(ctx context.Context, cmd *playlist.DeletePlayli err := s.sqlimpl.store.Delete(ctx, cmd) if err == nil { _, err = s.store.Delete(ctx, &entity.DeleteEntityRequest{ - GRN: &entity.GRN{ - UID: cmd.UID, - Kind: entity.StandardKindPlaylist, + GRN: &grn.GRN{ + ResourceIdentifier: cmd.UID, + ResourceKind: entity.StandardKindPlaylist, }, }) if err != nil { @@ -142,9 +143,9 @@ func (s *entityStoreImpl) GetWithoutItems(ctx context.Context, q *playlist.GetPl func (s *entityStoreImpl) Get(ctx context.Context, q *playlist.GetPlaylistByUidQuery) (*playlist.PlaylistDTO, error) { rsp, err := s.store.Read(ctx, &entity.ReadEntityRequest{ - GRN: &entity.GRN{ - UID: q.UID, - Kind: entity.StandardKindPlaylist, + GRN: &grn.GRN{ + ResourceIdentifier: q.UID, + ResourceKind: entity.StandardKindPlaylist, }, WithBody: true, }) @@ -178,7 +179,7 @@ func (s *entityStoreImpl) Search(ctx context.Context, q *playlist.GetPlaylistsQu err = json.Unmarshal(res.Body, found) } playlists = append(playlists, &playlist.Playlist{ - UID: res.GRN.UID, + UID: res.GRN.ResourceIdentifier, Name: res.Name, Interval: found.Interval, }) diff --git a/pkg/services/store/entity/entity.pb.go b/pkg/services/store/entity/entity.pb.go index fac59ab5a67..1201b7f71fc 100644 --- a/pkg/services/store/entity/entity.pb.go +++ b/pkg/services/store/entity/entity.pb.go @@ -1,17 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc-gen-go v1.30.0 +// protoc v4.23.4 // source: entity.proto package entity import ( - reflect "reflect" - sync "sync" - + grn "github.com/grafana/grafana/pkg/infra/grn" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -71,7 +71,7 @@ func (x WriteEntityResponse_Status) Number() protoreflect.EnumNumber { // Deprecated: Use WriteEntityResponse_Status.Descriptor instead. func (WriteEntityResponse_Status) EnumDescriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{10, 0} + return file_entity_proto_rawDescGZIP(), []int{9, 0} } // Status enumeration @@ -121,75 +121,7 @@ func (x EntityWatchResponse_Action) Number() protoreflect.EnumNumber { // Deprecated: Use EntityWatchResponse_Action.Descriptor instead. func (EntityWatchResponse_Action) EnumDescriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{19, 0} -} - -type GRN struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // the tenant/org id - TenantId int64 `protobuf:"varint,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - // Identify the entity kind. This kind will be used to apply a schema to the body and - // will trigger additional indexing behavior. - Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` - // Unique ID - // 40 characters or less, no slashes or other special characters - UID string `protobuf:"bytes,4,opt,name=UID,proto3" json:"UID,omitempty"` -} - -func (x *GRN) Reset() { - *x = GRN{} - if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GRN) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GRN) ProtoMessage() {} - -func (x *GRN) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[0] - 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 GRN.ProtoReflect.Descriptor instead. -func (*GRN) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{0} -} - -func (x *GRN) GetTenantId() int64 { - if x != nil { - return x.TenantId - } - return 0 -} - -func (x *GRN) GetKind() string { - if x != nil { - return x.Kind - } - return "" -} - -func (x *GRN) GetUID() string { - if x != nil { - return x.UID - } - return "" + return file_entity_proto_rawDescGZIP(), []int{18, 0} } // The canonical entity/document data -- this represents the raw bytes and storage level metadata @@ -198,8 +130,8 @@ type Entity struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + // Entity identifier -- tenant_id, kind, uid + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // The version will change when the entity is saved. It is not necessarily sortable Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Time in epoch milliseconds that the entity was created @@ -227,7 +159,7 @@ type Entity struct { func (x *Entity) Reset() { *x = Entity{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[1] + mi := &file_entity_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -240,7 +172,7 @@ func (x *Entity) String() string { func (*Entity) ProtoMessage() {} func (x *Entity) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[1] + mi := &file_entity_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -253,10 +185,10 @@ func (x *Entity) ProtoReflect() protoreflect.Message { // Deprecated: Use Entity.ProtoReflect.Descriptor instead. func (*Entity) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{1} + return file_entity_proto_rawDescGZIP(), []int{0} } -func (x *Entity) GetGRN() *GRN { +func (x *Entity) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -357,7 +289,7 @@ type EntityOriginInfo struct { func (x *EntityOriginInfo) Reset() { *x = EntityOriginInfo{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[2] + mi := &file_entity_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -370,7 +302,7 @@ func (x *EntityOriginInfo) String() string { func (*EntityOriginInfo) ProtoMessage() {} func (x *EntityOriginInfo) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[2] + mi := &file_entity_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -383,7 +315,7 @@ func (x *EntityOriginInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityOriginInfo.ProtoReflect.Descriptor instead. func (*EntityOriginInfo) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{2} + return file_entity_proto_rawDescGZIP(), []int{1} } func (x *EntityOriginInfo) GetSource() string { @@ -425,7 +357,7 @@ type EntityErrorInfo struct { func (x *EntityErrorInfo) Reset() { *x = EntityErrorInfo{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[3] + mi := &file_entity_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -438,7 +370,7 @@ func (x *EntityErrorInfo) String() string { func (*EntityErrorInfo) ProtoMessage() {} func (x *EntityErrorInfo) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[3] + mi := &file_entity_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -451,7 +383,7 @@ func (x *EntityErrorInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityErrorInfo.ProtoReflect.Descriptor instead. func (*EntityErrorInfo) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{3} + return file_entity_proto_rawDescGZIP(), []int{2} } func (x *EntityErrorInfo) GetCode() int64 { @@ -500,7 +432,7 @@ type EntityVersionInfo struct { func (x *EntityVersionInfo) Reset() { *x = EntityVersionInfo{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[4] + mi := &file_entity_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +445,7 @@ func (x *EntityVersionInfo) String() string { func (*EntityVersionInfo) ProtoMessage() {} func (x *EntityVersionInfo) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[4] + mi := &file_entity_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -526,7 +458,7 @@ func (x *EntityVersionInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityVersionInfo.ProtoReflect.Descriptor instead. func (*EntityVersionInfo) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{4} + return file_entity_proto_rawDescGZIP(), []int{3} } func (x *EntityVersionInfo) GetVersion() string { @@ -577,7 +509,7 @@ type ReadEntityRequest struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Fetch an explicit version Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Include the full body bytes @@ -589,7 +521,7 @@ type ReadEntityRequest struct { func (x *ReadEntityRequest) Reset() { *x = ReadEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[5] + mi := &file_entity_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -602,7 +534,7 @@ func (x *ReadEntityRequest) String() string { func (*ReadEntityRequest) ProtoMessage() {} func (x *ReadEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[5] + mi := &file_entity_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -615,10 +547,10 @@ func (x *ReadEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadEntityRequest.ProtoReflect.Descriptor instead. func (*ReadEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{5} + return file_entity_proto_rawDescGZIP(), []int{4} } -func (x *ReadEntityRequest) GetGRN() *GRN { +func (x *ReadEntityRequest) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -657,7 +589,7 @@ type BatchReadEntityRequest struct { func (x *BatchReadEntityRequest) Reset() { *x = BatchReadEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[6] + mi := &file_entity_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -670,7 +602,7 @@ func (x *BatchReadEntityRequest) String() string { func (*BatchReadEntityRequest) ProtoMessage() {} func (x *BatchReadEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[6] + mi := &file_entity_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -683,7 +615,7 @@ func (x *BatchReadEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadEntityRequest.ProtoReflect.Descriptor instead. func (*BatchReadEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{6} + return file_entity_proto_rawDescGZIP(), []int{5} } func (x *BatchReadEntityRequest) GetBatch() []*ReadEntityRequest { @@ -704,7 +636,7 @@ type BatchReadEntityResponse struct { func (x *BatchReadEntityResponse) Reset() { *x = BatchReadEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[7] + mi := &file_entity_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -717,7 +649,7 @@ func (x *BatchReadEntityResponse) String() string { func (*BatchReadEntityResponse) ProtoMessage() {} func (x *BatchReadEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[7] + mi := &file_entity_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -730,7 +662,7 @@ func (x *BatchReadEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BatchReadEntityResponse.ProtoReflect.Descriptor instead. func (*BatchReadEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{7} + return file_entity_proto_rawDescGZIP(), []int{6} } func (x *BatchReadEntityResponse) GetResults() []*Entity { @@ -746,7 +678,7 @@ type WriteEntityRequest struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Where to save the entity (empty will leave it unchanged) Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"` // The raw entity body @@ -760,7 +692,7 @@ type WriteEntityRequest struct { func (x *WriteEntityRequest) Reset() { *x = WriteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[8] + mi := &file_entity_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -773,7 +705,7 @@ func (x *WriteEntityRequest) String() string { func (*WriteEntityRequest) ProtoMessage() {} func (x *WriteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[8] + mi := &file_entity_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -786,10 +718,10 @@ func (x *WriteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteEntityRequest.ProtoReflect.Descriptor instead. func (*WriteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{8} + return file_entity_proto_rawDescGZIP(), []int{7} } -func (x *WriteEntityRequest) GetGRN() *GRN { +func (x *WriteEntityRequest) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -833,7 +765,7 @@ type AdminWriteEntityRequest struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Where to save the entity (empty will leave it unchanged) Folder string `protobuf:"bytes,2,opt,name=folder,proto3" json:"folder,omitempty"` // The raw entity body @@ -868,7 +800,7 @@ type AdminWriteEntityRequest struct { func (x *AdminWriteEntityRequest) Reset() { *x = AdminWriteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[9] + mi := &file_entity_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -881,7 +813,7 @@ func (x *AdminWriteEntityRequest) String() string { func (*AdminWriteEntityRequest) ProtoMessage() {} func (x *AdminWriteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[9] + mi := &file_entity_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -894,10 +826,10 @@ func (x *AdminWriteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AdminWriteEntityRequest.ProtoReflect.Descriptor instead. func (*AdminWriteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{9} + return file_entity_proto_rawDescGZIP(), []int{8} } -func (x *AdminWriteEntityRequest) GetGRN() *GRN { +func (x *AdminWriteEntityRequest) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -989,7 +921,7 @@ type WriteEntityResponse struct { // Error info -- if exists, the save did not happen Error *EntityErrorInfo `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // Entity identifier - GRN *GRN `protobuf:"bytes,2,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,2,opt,name=GRN,proto3" json:"GRN,omitempty"` // Entity details with the body removed Entity *EntityVersionInfo `protobuf:"bytes,3,opt,name=entity,proto3" json:"entity,omitempty"` // Entity summary as JSON @@ -1001,7 +933,7 @@ type WriteEntityResponse struct { func (x *WriteEntityResponse) Reset() { *x = WriteEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[10] + mi := &file_entity_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1014,7 +946,7 @@ func (x *WriteEntityResponse) String() string { func (*WriteEntityResponse) ProtoMessage() {} func (x *WriteEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[10] + mi := &file_entity_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1027,7 +959,7 @@ func (x *WriteEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WriteEntityResponse.ProtoReflect.Descriptor instead. func (*WriteEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{10} + return file_entity_proto_rawDescGZIP(), []int{9} } func (x *WriteEntityResponse) GetError() *EntityErrorInfo { @@ -1037,7 +969,7 @@ func (x *WriteEntityResponse) GetError() *EntityErrorInfo { return nil } -func (x *WriteEntityResponse) GetGRN() *GRN { +func (x *WriteEntityResponse) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -1071,7 +1003,7 @@ type DeleteEntityRequest struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Used for optimistic locking. If missing, the previous version will be replaced regardless PreviousVersion string `protobuf:"bytes,3,opt,name=previous_version,json=previousVersion,proto3" json:"previous_version,omitempty"` } @@ -1079,7 +1011,7 @@ type DeleteEntityRequest struct { func (x *DeleteEntityRequest) Reset() { *x = DeleteEntityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[11] + mi := &file_entity_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1092,7 +1024,7 @@ func (x *DeleteEntityRequest) String() string { func (*DeleteEntityRequest) ProtoMessage() {} func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[11] + mi := &file_entity_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1105,10 +1037,10 @@ func (x *DeleteEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntityRequest.ProtoReflect.Descriptor instead. func (*DeleteEntityRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{11} + return file_entity_proto_rawDescGZIP(), []int{10} } -func (x *DeleteEntityRequest) GetGRN() *GRN { +func (x *DeleteEntityRequest) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -1133,7 +1065,7 @@ type DeleteEntityResponse struct { func (x *DeleteEntityResponse) Reset() { *x = DeleteEntityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[12] + mi := &file_entity_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1146,7 +1078,7 @@ func (x *DeleteEntityResponse) String() string { func (*DeleteEntityResponse) ProtoMessage() {} func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[12] + mi := &file_entity_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1159,7 +1091,7 @@ func (x *DeleteEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteEntityResponse.ProtoReflect.Descriptor instead. func (*DeleteEntityResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{12} + return file_entity_proto_rawDescGZIP(), []int{11} } func (x *DeleteEntityResponse) GetOK() bool { @@ -1175,7 +1107,7 @@ type EntityHistoryRequest struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Maximum number of items to return Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // Starting from the requested page @@ -1185,7 +1117,7 @@ type EntityHistoryRequest struct { func (x *EntityHistoryRequest) Reset() { *x = EntityHistoryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[13] + mi := &file_entity_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1198,7 +1130,7 @@ func (x *EntityHistoryRequest) String() string { func (*EntityHistoryRequest) ProtoMessage() {} func (x *EntityHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[13] + mi := &file_entity_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1211,10 +1143,10 @@ func (x *EntityHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityHistoryRequest.ProtoReflect.Descriptor instead. func (*EntityHistoryRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{13} + return file_entity_proto_rawDescGZIP(), []int{12} } -func (x *EntityHistoryRequest) GetGRN() *GRN { +func (x *EntityHistoryRequest) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -1241,7 +1173,7 @@ type EntityHistoryResponse struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // Entity metadata without the raw bytes Versions []*EntityVersionInfo `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` // More results exist... pass this in the next request @@ -1251,7 +1183,7 @@ type EntityHistoryResponse struct { func (x *EntityHistoryResponse) Reset() { *x = EntityHistoryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[14] + mi := &file_entity_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1264,7 +1196,7 @@ func (x *EntityHistoryResponse) String() string { func (*EntityHistoryResponse) ProtoMessage() {} func (x *EntityHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[14] + mi := &file_entity_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1277,10 +1209,10 @@ func (x *EntityHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityHistoryResponse.ProtoReflect.Descriptor instead. func (*EntityHistoryResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{14} + return file_entity_proto_rawDescGZIP(), []int{13} } -func (x *EntityHistoryResponse) GetGRN() *GRN { +func (x *EntityHistoryResponse) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -1331,7 +1263,7 @@ type EntitySearchRequest struct { func (x *EntitySearchRequest) Reset() { *x = EntitySearchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[15] + mi := &file_entity_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1344,7 +1276,7 @@ func (x *EntitySearchRequest) String() string { func (*EntitySearchRequest) ProtoMessage() {} func (x *EntitySearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[15] + mi := &file_entity_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1357,7 +1289,7 @@ func (x *EntitySearchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchRequest.ProtoReflect.Descriptor instead. func (*EntitySearchRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{15} + return file_entity_proto_rawDescGZIP(), []int{14} } func (x *EntitySearchRequest) GetNextPageToken() string { @@ -1437,7 +1369,7 @@ type EntitySearchResult struct { unknownFields protoimpl.UnknownFields // Entity identifier - GRN *GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` + GRN *grn.GRN `protobuf:"bytes,1,opt,name=GRN,proto3" json:"GRN,omitempty"` // The current version of this entity Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Content Length @@ -1467,7 +1399,7 @@ type EntitySearchResult struct { func (x *EntitySearchResult) Reset() { *x = EntitySearchResult{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[16] + mi := &file_entity_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1480,7 +1412,7 @@ func (x *EntitySearchResult) String() string { func (*EntitySearchResult) ProtoMessage() {} func (x *EntitySearchResult) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[16] + mi := &file_entity_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1493,10 +1425,10 @@ func (x *EntitySearchResult) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchResult.ProtoReflect.Descriptor instead. func (*EntitySearchResult) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{16} + return file_entity_proto_rawDescGZIP(), []int{15} } -func (x *EntitySearchResult) GetGRN() *GRN { +func (x *EntitySearchResult) GetGRN() *grn.GRN { if x != nil { return x.GRN } @@ -1600,7 +1532,7 @@ type EntitySearchResponse struct { func (x *EntitySearchResponse) Reset() { *x = EntitySearchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[17] + mi := &file_entity_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1613,7 +1545,7 @@ func (x *EntitySearchResponse) String() string { func (*EntitySearchResponse) ProtoMessage() {} func (x *EntitySearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[17] + mi := &file_entity_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1626,7 +1558,7 @@ func (x *EntitySearchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EntitySearchResponse.ProtoReflect.Descriptor instead. func (*EntitySearchResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{17} + return file_entity_proto_rawDescGZIP(), []int{16} } func (x *EntitySearchResponse) GetResults() []*EntitySearchResult { @@ -1651,7 +1583,7 @@ type EntityWatchRequest struct { // Timestamp of last changes. Empty will default to Since int64 `protobuf:"varint,1,opt,name=since,proto3" json:"since,omitempty"` // Watch sppecific entities - GRN []*GRN `protobuf:"bytes,2,rep,name=GRN,proto3" json:"GRN,omitempty"` + GRN []*grn.GRN `protobuf:"bytes,2,rep,name=GRN,proto3" json:"GRN,omitempty"` // limit to a specific kind (empty is all) Kind []string `protobuf:"bytes,3,rep,name=kind,proto3" json:"kind,omitempty"` // Limit results to items in a specific folder @@ -1669,7 +1601,7 @@ type EntityWatchRequest struct { func (x *EntityWatchRequest) Reset() { *x = EntityWatchRequest{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[18] + mi := &file_entity_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1682,7 +1614,7 @@ func (x *EntityWatchRequest) String() string { func (*EntityWatchRequest) ProtoMessage() {} func (x *EntityWatchRequest) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[18] + mi := &file_entity_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1695,7 +1627,7 @@ func (x *EntityWatchRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityWatchRequest.ProtoReflect.Descriptor instead. func (*EntityWatchRequest) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{18} + return file_entity_proto_rawDescGZIP(), []int{17} } func (x *EntityWatchRequest) GetSince() int64 { @@ -1705,7 +1637,7 @@ func (x *EntityWatchRequest) GetSince() int64 { return 0 } -func (x *EntityWatchRequest) GetGRN() []*GRN { +func (x *EntityWatchRequest) GetGRN() []*grn.GRN { if x != nil { return x.GRN } @@ -1770,7 +1702,7 @@ type EntityWatchResponse struct { func (x *EntityWatchResponse) Reset() { *x = EntityWatchResponse{} if protoimpl.UnsafeEnabled { - mi := &file_entity_proto_msgTypes[19] + mi := &file_entity_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1783,7 +1715,7 @@ func (x *EntityWatchResponse) String() string { func (*EntityWatchResponse) ProtoMessage() {} func (x *EntityWatchResponse) ProtoReflect() protoreflect.Message { - mi := &file_entity_proto_msgTypes[19] + mi := &file_entity_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1796,7 +1728,7 @@ func (x *EntityWatchResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityWatchResponse.ProtoReflect.Descriptor instead. func (*EntityWatchResponse) Descriptor() ([]byte, []int) { - return file_entity_proto_rawDescGZIP(), []int{19} + return file_entity_proto_rawDescGZIP(), []int{18} } func (x *EntityWatchResponse) GetTimestamp() int64 { @@ -1824,116 +1756,112 @@ var File_entity_proto protoreflect.FileDescriptor var file_entity_proto_rawDesc = []byte{ 0x0a, 0x0c, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x22, 0x48, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x1b, 0x0a, - 0x09, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x74, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, - 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x55, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x55, 0x49, 0x44, - 0x22, 0xe6, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x03, 0x47, - 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 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, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, - 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, - 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, - 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, - 0xad, 0x01, 0x0a, 0x11, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x1a, 0x17, 0x70, 0x6b, 0x67, 0x2f, 0x69, 0x6e, 0x66, 0x72, + 0x61, 0x2f, 0x67, 0x72, 0x6e, 0x2f, 0x67, 0x72, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xe3, 0x02, 0x0a, 0x06, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, + 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, + 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 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, + 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, - 0x8c, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, - 0x03, 0x47, 0x52, 0x4e, 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, 0x12, 0x1b, - 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x77, - 0x69, 0x74, 0x68, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x49, - 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x22, 0x43, 0x0a, 0x17, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa4, - 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, - 0x03, 0x47, 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x96, 0x03, 0x0a, 0x17, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, - 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, - 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x62, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, - 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, - 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x65, 0x61, 0x72, - 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, - 0x63, 0x6c, 0x65, 0x61, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x30, 0x0a, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0xb3, - 0x02, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, + 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x16, 0x0a, 0x06, + 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, + 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4a, + 0x73, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x0f, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x22, 0xad, 0x01, 0x0a, 0x11, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, + 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x45, 0x54, 0x61, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x45, 0x54, 0x61, + 0x67, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x89, 0x01, 0x0a, 0x11, + 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, + 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 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, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, + 0x42, 0x6f, 0x64, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x73, 0x75, 0x6d, + 0x6d, 0x61, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, + 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x49, 0x0a, 0x16, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x05, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x22, 0x43, 0x0a, 0x17, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, + 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, + 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x07, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa1, 0x01, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, + 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, + 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, + 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, + 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, + 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x03, 0x0a, 0x17, + 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, + 0x47, 0x52, 0x4e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x62, + 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x62, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, + 0x65, 0x61, 0x72, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, + 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x22, 0xb0, 0x02, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x31, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, @@ -1947,170 +1875,171 @@ var file_entity_proto_rawDesc = []byte{ 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 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, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x43, 0x48, 0x41, 0x4e, 0x47, - 0x45, 0x44, 0x10, 0x03, 0x22, 0x5f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, - 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x4f, 0x4b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x4b, 0x22, 0x73, 0x0a, - 0x14, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, - 0x03, 0x47, 0x52, 0x4e, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x95, 0x01, 0x0a, 0x15, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x03, - 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x35, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 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, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, - 0x6c, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x45, 0x44, 0x10, 0x03, 0x22, 0x5c, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x47, + 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, + 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x65, 0x76, 0x69, + 0x6f, 0x75, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0x26, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x4f, 0x4b, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x4b, 0x22, 0x70, 0x0a, 0x14, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x14, + 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, + 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x92, 0x01, 0x0a, + 0x15, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, + 0x52, 0x4e, 0x12, 0x35, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x84, 0x03, 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 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, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x12, 0x0a, + 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x06, 0x6c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, + 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x77, + 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xcd, 0x03, 0x0a, 0x12, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x1a, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, + 0x72, 0x6e, 0x2e, 0x47, 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 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, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, + 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x1f, 0x0a, + 0x0b, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, + 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x74, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 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, 0x22, 0xcc, + 0x02, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x03, 0x47, + 0x52, 0x4e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x67, 0x72, 0x6e, 0x2e, 0x47, + 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, - 0x42, 0x6f, 0x64, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0xd0, 0x03, 0x0a, 0x12, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, - 0x52, 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 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, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x62, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x42, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, - 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x66, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, - 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4a, 0x73, 0x6f, 0x6e, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 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, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x74, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 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, 0x22, 0xcf, 0x02, 0x0a, 0x12, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x05, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x03, 0x47, 0x52, 0x4e, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x47, 0x52, - 0x4e, 0x52, 0x03, 0x47, 0x52, 0x4e, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, - 0x6c, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, 0x12, - 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x01, 0x0a, - 0x13, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 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, 0x26, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, 0x32, 0xb2, 0x04, 0x0a, 0x0b, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, 0x12, - 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x61, - 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x46, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x05, - 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, - 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, 0x10, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x1f, - 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0b, 0x5a, 0x09, - 0x2e, 0x2f, 0x3b, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x65, 0x6c, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x62, 0x6f, 0x64, 0x79, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x42, 0x6f, 0x64, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x69, 0x74, 0x68, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 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, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xc8, 0x01, + 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 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, 0x26, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x3a, 0x0a, 0x06, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, + 0x0a, 0x07, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, 0x32, 0xb2, 0x04, 0x0a, 0x0b, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x52, 0x65, 0x61, 0x64, + 0x12, 0x19, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x4c, 0x0a, 0x09, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x12, 0x1e, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2e, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x61, 0x64, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x05, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x12, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x46, 0x0a, 0x07, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x2e, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x12, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x05, 0x57, 0x61, 0x74, 0x63, 0x68, 0x12, 0x1a, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x45, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, + 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x5e, 0x0a, + 0x10, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x41, 0x64, 0x6d, 0x69, + 0x6e, 0x12, 0x4a, 0x0a, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, + 0x1f, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1b, 0x2e, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x36, 0x5a, + 0x34, 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, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2126,77 +2055,77 @@ func file_entity_proto_rawDescGZIP() []byte { } var file_entity_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_entity_proto_msgTypes = make([]protoimpl.MessageInfo, 23) -var file_entity_proto_goTypes = []any{ +var file_entity_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_entity_proto_goTypes = []interface{}{ (WriteEntityResponse_Status)(0), // 0: entity.WriteEntityResponse.Status (EntityWatchResponse_Action)(0), // 1: entity.EntityWatchResponse.Action - (*GRN)(nil), // 2: entity.GRN - (*Entity)(nil), // 3: entity.Entity - (*EntityOriginInfo)(nil), // 4: entity.EntityOriginInfo - (*EntityErrorInfo)(nil), // 5: entity.EntityErrorInfo - (*EntityVersionInfo)(nil), // 6: entity.EntityVersionInfo - (*ReadEntityRequest)(nil), // 7: entity.ReadEntityRequest - (*BatchReadEntityRequest)(nil), // 8: entity.BatchReadEntityRequest - (*BatchReadEntityResponse)(nil), // 9: entity.BatchReadEntityResponse - (*WriteEntityRequest)(nil), // 10: entity.WriteEntityRequest - (*AdminWriteEntityRequest)(nil), // 11: entity.AdminWriteEntityRequest - (*WriteEntityResponse)(nil), // 12: entity.WriteEntityResponse - (*DeleteEntityRequest)(nil), // 13: entity.DeleteEntityRequest - (*DeleteEntityResponse)(nil), // 14: entity.DeleteEntityResponse - (*EntityHistoryRequest)(nil), // 15: entity.EntityHistoryRequest - (*EntityHistoryResponse)(nil), // 16: entity.EntityHistoryResponse - (*EntitySearchRequest)(nil), // 17: entity.EntitySearchRequest - (*EntitySearchResult)(nil), // 18: entity.EntitySearchResult - (*EntitySearchResponse)(nil), // 19: entity.EntitySearchResponse - (*EntityWatchRequest)(nil), // 20: entity.EntityWatchRequest - (*EntityWatchResponse)(nil), // 21: entity.EntityWatchResponse - nil, // 22: entity.EntitySearchRequest.LabelsEntry - nil, // 23: entity.EntitySearchResult.LabelsEntry - nil, // 24: entity.EntityWatchRequest.LabelsEntry + (*Entity)(nil), // 2: entity.Entity + (*EntityOriginInfo)(nil), // 3: entity.EntityOriginInfo + (*EntityErrorInfo)(nil), // 4: entity.EntityErrorInfo + (*EntityVersionInfo)(nil), // 5: entity.EntityVersionInfo + (*ReadEntityRequest)(nil), // 6: entity.ReadEntityRequest + (*BatchReadEntityRequest)(nil), // 7: entity.BatchReadEntityRequest + (*BatchReadEntityResponse)(nil), // 8: entity.BatchReadEntityResponse + (*WriteEntityRequest)(nil), // 9: entity.WriteEntityRequest + (*AdminWriteEntityRequest)(nil), // 10: entity.AdminWriteEntityRequest + (*WriteEntityResponse)(nil), // 11: entity.WriteEntityResponse + (*DeleteEntityRequest)(nil), // 12: entity.DeleteEntityRequest + (*DeleteEntityResponse)(nil), // 13: entity.DeleteEntityResponse + (*EntityHistoryRequest)(nil), // 14: entity.EntityHistoryRequest + (*EntityHistoryResponse)(nil), // 15: entity.EntityHistoryResponse + (*EntitySearchRequest)(nil), // 16: entity.EntitySearchRequest + (*EntitySearchResult)(nil), // 17: entity.EntitySearchResult + (*EntitySearchResponse)(nil), // 18: entity.EntitySearchResponse + (*EntityWatchRequest)(nil), // 19: entity.EntityWatchRequest + (*EntityWatchResponse)(nil), // 20: entity.EntityWatchResponse + nil, // 21: entity.EntitySearchRequest.LabelsEntry + nil, // 22: entity.EntitySearchResult.LabelsEntry + nil, // 23: entity.EntityWatchRequest.LabelsEntry + (*grn.GRN)(nil), // 24: grn.GRN } var file_entity_proto_depIdxs = []int32{ - 2, // 0: entity.Entity.GRN:type_name -> entity.GRN - 4, // 1: entity.Entity.origin:type_name -> entity.EntityOriginInfo - 2, // 2: entity.ReadEntityRequest.GRN:type_name -> entity.GRN - 7, // 3: entity.BatchReadEntityRequest.batch:type_name -> entity.ReadEntityRequest - 3, // 4: entity.BatchReadEntityResponse.results:type_name -> entity.Entity - 2, // 5: entity.WriteEntityRequest.GRN:type_name -> entity.GRN - 2, // 6: entity.AdminWriteEntityRequest.GRN:type_name -> entity.GRN - 4, // 7: entity.AdminWriteEntityRequest.origin:type_name -> entity.EntityOriginInfo - 5, // 8: entity.WriteEntityResponse.error:type_name -> entity.EntityErrorInfo - 2, // 9: entity.WriteEntityResponse.GRN:type_name -> entity.GRN - 6, // 10: entity.WriteEntityResponse.entity:type_name -> entity.EntityVersionInfo + 24, // 0: entity.Entity.GRN:type_name -> grn.GRN + 3, // 1: entity.Entity.origin:type_name -> entity.EntityOriginInfo + 24, // 2: entity.ReadEntityRequest.GRN:type_name -> grn.GRN + 6, // 3: entity.BatchReadEntityRequest.batch:type_name -> entity.ReadEntityRequest + 2, // 4: entity.BatchReadEntityResponse.results:type_name -> entity.Entity + 24, // 5: entity.WriteEntityRequest.GRN:type_name -> grn.GRN + 24, // 6: entity.AdminWriteEntityRequest.GRN:type_name -> grn.GRN + 3, // 7: entity.AdminWriteEntityRequest.origin:type_name -> entity.EntityOriginInfo + 4, // 8: entity.WriteEntityResponse.error:type_name -> entity.EntityErrorInfo + 24, // 9: entity.WriteEntityResponse.GRN:type_name -> grn.GRN + 5, // 10: entity.WriteEntityResponse.entity:type_name -> entity.EntityVersionInfo 0, // 11: entity.WriteEntityResponse.status:type_name -> entity.WriteEntityResponse.Status - 2, // 12: entity.DeleteEntityRequest.GRN:type_name -> entity.GRN - 2, // 13: entity.EntityHistoryRequest.GRN:type_name -> entity.GRN - 2, // 14: entity.EntityHistoryResponse.GRN:type_name -> entity.GRN - 6, // 15: entity.EntityHistoryResponse.versions:type_name -> entity.EntityVersionInfo - 22, // 16: entity.EntitySearchRequest.labels:type_name -> entity.EntitySearchRequest.LabelsEntry - 2, // 17: entity.EntitySearchResult.GRN:type_name -> entity.GRN - 23, // 18: entity.EntitySearchResult.labels:type_name -> entity.EntitySearchResult.LabelsEntry - 18, // 19: entity.EntitySearchResponse.results:type_name -> entity.EntitySearchResult - 2, // 20: entity.EntityWatchRequest.GRN:type_name -> entity.GRN - 24, // 21: entity.EntityWatchRequest.labels:type_name -> entity.EntityWatchRequest.LabelsEntry - 3, // 22: entity.EntityWatchResponse.entity:type_name -> entity.Entity + 24, // 12: entity.DeleteEntityRequest.GRN:type_name -> grn.GRN + 24, // 13: entity.EntityHistoryRequest.GRN:type_name -> grn.GRN + 24, // 14: entity.EntityHistoryResponse.GRN:type_name -> grn.GRN + 5, // 15: entity.EntityHistoryResponse.versions:type_name -> entity.EntityVersionInfo + 21, // 16: entity.EntitySearchRequest.labels:type_name -> entity.EntitySearchRequest.LabelsEntry + 24, // 17: entity.EntitySearchResult.GRN:type_name -> grn.GRN + 22, // 18: entity.EntitySearchResult.labels:type_name -> entity.EntitySearchResult.LabelsEntry + 17, // 19: entity.EntitySearchResponse.results:type_name -> entity.EntitySearchResult + 24, // 20: entity.EntityWatchRequest.GRN:type_name -> grn.GRN + 23, // 21: entity.EntityWatchRequest.labels:type_name -> entity.EntityWatchRequest.LabelsEntry + 2, // 22: entity.EntityWatchResponse.entity:type_name -> entity.Entity 1, // 23: entity.EntityWatchResponse.action:type_name -> entity.EntityWatchResponse.Action - 7, // 24: entity.EntityStore.Read:input_type -> entity.ReadEntityRequest - 8, // 25: entity.EntityStore.BatchRead:input_type -> entity.BatchReadEntityRequest - 10, // 26: entity.EntityStore.Write:input_type -> entity.WriteEntityRequest - 13, // 27: entity.EntityStore.Delete:input_type -> entity.DeleteEntityRequest - 15, // 28: entity.EntityStore.History:input_type -> entity.EntityHistoryRequest - 17, // 29: entity.EntityStore.Search:input_type -> entity.EntitySearchRequest - 20, // 30: entity.EntityStore.Watch:input_type -> entity.EntityWatchRequest - 11, // 31: entity.EntityStore.AdminWrite:input_type -> entity.AdminWriteEntityRequest - 11, // 32: entity.EntityStoreAdmin.AdminWrite:input_type -> entity.AdminWriteEntityRequest - 3, // 33: entity.EntityStore.Read:output_type -> entity.Entity - 9, // 34: entity.EntityStore.BatchRead:output_type -> entity.BatchReadEntityResponse - 12, // 35: entity.EntityStore.Write:output_type -> entity.WriteEntityResponse - 14, // 36: entity.EntityStore.Delete:output_type -> entity.DeleteEntityResponse - 16, // 37: entity.EntityStore.History:output_type -> entity.EntityHistoryResponse - 19, // 38: entity.EntityStore.Search:output_type -> entity.EntitySearchResponse - 21, // 39: entity.EntityStore.Watch:output_type -> entity.EntityWatchResponse - 12, // 40: entity.EntityStore.AdminWrite:output_type -> entity.WriteEntityResponse - 12, // 41: entity.EntityStoreAdmin.AdminWrite:output_type -> entity.WriteEntityResponse + 6, // 24: entity.EntityStore.Read:input_type -> entity.ReadEntityRequest + 7, // 25: entity.EntityStore.BatchRead:input_type -> entity.BatchReadEntityRequest + 9, // 26: entity.EntityStore.Write:input_type -> entity.WriteEntityRequest + 12, // 27: entity.EntityStore.Delete:input_type -> entity.DeleteEntityRequest + 14, // 28: entity.EntityStore.History:input_type -> entity.EntityHistoryRequest + 16, // 29: entity.EntityStore.Search:input_type -> entity.EntitySearchRequest + 19, // 30: entity.EntityStore.Watch:input_type -> entity.EntityWatchRequest + 10, // 31: entity.EntityStore.AdminWrite:input_type -> entity.AdminWriteEntityRequest + 10, // 32: entity.EntityStoreAdmin.AdminWrite:input_type -> entity.AdminWriteEntityRequest + 2, // 33: entity.EntityStore.Read:output_type -> entity.Entity + 8, // 34: entity.EntityStore.BatchRead:output_type -> entity.BatchReadEntityResponse + 11, // 35: entity.EntityStore.Write:output_type -> entity.WriteEntityResponse + 13, // 36: entity.EntityStore.Delete:output_type -> entity.DeleteEntityResponse + 15, // 37: entity.EntityStore.History:output_type -> entity.EntityHistoryResponse + 18, // 38: entity.EntityStore.Search:output_type -> entity.EntitySearchResponse + 20, // 39: entity.EntityStore.Watch:output_type -> entity.EntityWatchResponse + 11, // 40: entity.EntityStore.AdminWrite:output_type -> entity.WriteEntityResponse + 11, // 41: entity.EntityStoreAdmin.AdminWrite:output_type -> entity.WriteEntityResponse 33, // [33:42] is the sub-list for method output_type 24, // [24:33] is the sub-list for method input_type 24, // [24:24] is the sub-list for extension type_name @@ -2210,19 +2139,7 @@ func file_entity_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_entity_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*GRN); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_entity_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Entity); i { case 0: return &v.state @@ -2234,7 +2151,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityOriginInfo); i { case 0: return &v.state @@ -2246,7 +2163,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityErrorInfo); i { case 0: return &v.state @@ -2258,7 +2175,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityVersionInfo); i { case 0: return &v.state @@ -2270,7 +2187,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadEntityRequest); i { case 0: return &v.state @@ -2282,7 +2199,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchReadEntityRequest); i { case 0: return &v.state @@ -2294,7 +2211,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BatchReadEntityResponse); i { case 0: return &v.state @@ -2306,7 +2223,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WriteEntityRequest); i { case 0: return &v.state @@ -2318,7 +2235,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AdminWriteEntityRequest); i { case 0: return &v.state @@ -2330,7 +2247,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*WriteEntityResponse); i { case 0: return &v.state @@ -2342,7 +2259,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteEntityRequest); i { case 0: return &v.state @@ -2354,7 +2271,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteEntityResponse); i { case 0: return &v.state @@ -2366,7 +2283,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityHistoryRequest); i { case 0: return &v.state @@ -2378,7 +2295,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityHistoryResponse); i { case 0: return &v.state @@ -2390,7 +2307,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchRequest); i { case 0: return &v.state @@ -2402,7 +2319,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[16].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchResult); i { case 0: return &v.state @@ -2414,7 +2331,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[17].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntitySearchResponse); i { case 0: return &v.state @@ -2426,7 +2343,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[18].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityWatchRequest); i { case 0: return &v.state @@ -2438,7 +2355,7 @@ func file_entity_proto_init() { return nil } } - file_entity_proto_msgTypes[19].Exporter = func(v any, i int) any { + file_entity_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EntityWatchResponse); i { case 0: return &v.state @@ -2457,7 +2374,7 @@ func file_entity_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entity_proto_rawDesc, NumEnums: 2, - NumMessages: 23, + NumMessages: 22, NumExtensions: 0, NumServices: 2, }, diff --git a/pkg/services/store/entity/entity.proto b/pkg/services/store/entity/entity.proto index 6b853169eb4..52682a88806 100644 --- a/pkg/services/store/entity/entity.proto +++ b/pkg/services/store/entity/entity.proto @@ -1,25 +1,14 @@ syntax = "proto3"; package entity; -option go_package = "./;entity"; +option go_package = "github.com/grafana/grafana/pkg/services/store/entity"; -message GRN { - // the tenant/org id - int64 tenant_id = 1; - - // Identify the entity kind. This kind will be used to apply a schema to the body and - // will trigger additional indexing behavior. - string kind = 3; - - // Unique ID - // 40 characters or less, no slashes or other special characters - string UID = 4; -} +import "pkg/infra/grn/grn.proto"; // The canonical entity/document data -- this represents the raw bytes and storage level metadata message Entity { - // Entity identifier - GRN GRN = 1; + // Entity identifier -- tenant_id, kind, uid + grn.GRN GRN = 1; // The version will change when the entity is saved. It is not necessarily sortable string version = 2; @@ -109,7 +98,7 @@ message EntityVersionInfo { message ReadEntityRequest { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Fetch an explicit version string version = 2; @@ -139,7 +128,7 @@ message BatchReadEntityResponse { message WriteEntityRequest { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Where to save the entity (empty will leave it unchanged) string folder = 2; @@ -159,7 +148,7 @@ message WriteEntityRequest { // This process can bypass the forced checks that message AdminWriteEntityRequest { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Where to save the entity (empty will leave it unchanged) string folder = 2; @@ -207,7 +196,7 @@ message WriteEntityResponse { EntityErrorInfo error = 1; // Entity identifier - GRN GRN = 2; + grn.GRN GRN = 2; // Entity details with the body removed EntityVersionInfo entity = 3; @@ -233,7 +222,7 @@ message WriteEntityResponse { message DeleteEntityRequest { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Used for optimistic locking. If missing, the previous version will be replaced regardless string previous_version = 3; @@ -249,7 +238,7 @@ message DeleteEntityResponse { message EntityHistoryRequest { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Maximum number of items to return int64 limit = 3; @@ -260,7 +249,7 @@ message EntityHistoryRequest { message EntityHistoryResponse { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // Entity metadata without the raw bytes repeated EntityVersionInfo versions = 2; @@ -309,7 +298,7 @@ message EntitySearchRequest { // Search result metadata for each entity message EntitySearchResult { // Entity identifier - GRN GRN = 1; + grn.GRN GRN = 1; // The current version of this entity string version = 2; @@ -368,7 +357,7 @@ message EntityWatchRequest { int64 since = 1; // Watch sppecific entities - repeated GRN GRN = 2; + repeated grn.GRN GRN = 2; // limit to a specific kind (empty is all) repeated string kind = 3; diff --git a/pkg/services/store/entity/entity_grpc.pb.go b/pkg/services/store/entity/entity_grpc.pb.go index 19bcd3b6234..b7647be1c4b 100644 --- a/pkg/services/store/entity/entity_grpc.pb.go +++ b/pkg/services/store/entity/entity_grpc.pb.go @@ -1,14 +1,13 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.12 +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.23.4 // source: entity.proto package entity import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -19,6 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + EntityStore_Read_FullMethodName = "/entity.EntityStore/Read" + EntityStore_BatchRead_FullMethodName = "/entity.EntityStore/BatchRead" + EntityStore_Write_FullMethodName = "/entity.EntityStore/Write" + EntityStore_Delete_FullMethodName = "/entity.EntityStore/Delete" + EntityStore_History_FullMethodName = "/entity.EntityStore/History" + EntityStore_Search_FullMethodName = "/entity.EntityStore/Search" + EntityStore_Watch_FullMethodName = "/entity.EntityStore/Watch" + EntityStore_AdminWrite_FullMethodName = "/entity.EntityStore/AdminWrite" +) + // EntityStoreClient is the client API for EntityStore service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -44,7 +54,7 @@ func NewEntityStoreClient(cc grpc.ClientConnInterface) EntityStoreClient { func (c *entityStoreClient) Read(ctx context.Context, in *ReadEntityRequest, opts ...grpc.CallOption) (*Entity, error) { out := new(Entity) - err := c.cc.Invoke(ctx, "/entity.EntityStore/Read", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_Read_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -53,7 +63,7 @@ func (c *entityStoreClient) Read(ctx context.Context, in *ReadEntityRequest, opt func (c *entityStoreClient) BatchRead(ctx context.Context, in *BatchReadEntityRequest, opts ...grpc.CallOption) (*BatchReadEntityResponse, error) { out := new(BatchReadEntityResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/BatchRead", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_BatchRead_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -62,7 +72,7 @@ func (c *entityStoreClient) BatchRead(ctx context.Context, in *BatchReadEntityRe func (c *entityStoreClient) Write(ctx context.Context, in *WriteEntityRequest, opts ...grpc.CallOption) (*WriteEntityResponse, error) { out := new(WriteEntityResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/Write", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_Write_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -71,7 +81,7 @@ func (c *entityStoreClient) Write(ctx context.Context, in *WriteEntityRequest, o func (c *entityStoreClient) Delete(ctx context.Context, in *DeleteEntityRequest, opts ...grpc.CallOption) (*DeleteEntityResponse, error) { out := new(DeleteEntityResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/Delete", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_Delete_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -80,7 +90,7 @@ func (c *entityStoreClient) Delete(ctx context.Context, in *DeleteEntityRequest, func (c *entityStoreClient) History(ctx context.Context, in *EntityHistoryRequest, opts ...grpc.CallOption) (*EntityHistoryResponse, error) { out := new(EntityHistoryResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/History", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_History_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -89,7 +99,7 @@ func (c *entityStoreClient) History(ctx context.Context, in *EntityHistoryReques func (c *entityStoreClient) Search(ctx context.Context, in *EntitySearchRequest, opts ...grpc.CallOption) (*EntitySearchResponse, error) { out := new(EntitySearchResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/Search", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_Search_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -97,7 +107,7 @@ func (c *entityStoreClient) Search(ctx context.Context, in *EntitySearchRequest, } func (c *entityStoreClient) Watch(ctx context.Context, in *EntityWatchRequest, opts ...grpc.CallOption) (EntityStore_WatchClient, error) { - stream, err := c.cc.NewStream(ctx, &EntityStore_ServiceDesc.Streams[0], "/entity.EntityStore/Watch", opts...) + stream, err := c.cc.NewStream(ctx, &EntityStore_ServiceDesc.Streams[0], EntityStore_Watch_FullMethodName, opts...) if err != nil { return nil, err } @@ -130,7 +140,7 @@ func (x *entityStoreWatchClient) Recv() (*EntityWatchResponse, error) { func (c *entityStoreClient) AdminWrite(ctx context.Context, in *AdminWriteEntityRequest, opts ...grpc.CallOption) (*WriteEntityResponse, error) { out := new(WriteEntityResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStore/AdminWrite", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStore_AdminWrite_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -192,7 +202,7 @@ func RegisterEntityStoreServer(s grpc.ServiceRegistrar, srv EntityStoreServer) { s.RegisterService(&EntityStore_ServiceDesc, srv) } -func _EntityStore_Read_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ReadEntityRequest) if err := dec(in); err != nil { return nil, err @@ -202,15 +212,15 @@ func _EntityStore_Read_Handler(srv any, ctx context.Context, dec func(any) error } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/Read", + FullMethod: EntityStore_Read_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).Read(ctx, req.(*ReadEntityRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_BatchRead_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_BatchRead_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BatchReadEntityRequest) if err := dec(in); err != nil { return nil, err @@ -220,15 +230,15 @@ func _EntityStore_BatchRead_Handler(srv any, ctx context.Context, dec func(any) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/BatchRead", + FullMethod: EntityStore_BatchRead_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).BatchRead(ctx, req.(*BatchReadEntityRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_Write_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(WriteEntityRequest) if err := dec(in); err != nil { return nil, err @@ -238,15 +248,15 @@ func _EntityStore_Write_Handler(srv any, ctx context.Context, dec func(any) erro } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/Write", + FullMethod: EntityStore_Write_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).Write(ctx, req.(*WriteEntityRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_Delete_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteEntityRequest) if err := dec(in); err != nil { return nil, err @@ -256,15 +266,15 @@ func _EntityStore_Delete_Handler(srv any, ctx context.Context, dec func(any) err } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/Delete", + FullMethod: EntityStore_Delete_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).Delete(ctx, req.(*DeleteEntityRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_History_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_History_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EntityHistoryRequest) if err := dec(in); err != nil { return nil, err @@ -274,15 +284,15 @@ func _EntityStore_History_Handler(srv any, ctx context.Context, dec func(any) er } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/History", + FullMethod: EntityStore_History_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).History(ctx, req.(*EntityHistoryRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_Search_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EntitySearchRequest) if err := dec(in); err != nil { return nil, err @@ -292,15 +302,15 @@ func _EntityStore_Search_Handler(srv any, ctx context.Context, dec func(any) err } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/Search", + FullMethod: EntityStore_Search_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).Search(ctx, req.(*EntitySearchRequest)) } return interceptor(ctx, in, info, handler) } -func _EntityStore_Watch_Handler(srv any, stream grpc.ServerStream) error { +func _EntityStore_Watch_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(EntityWatchRequest) if err := stream.RecvMsg(m); err != nil { return err @@ -321,7 +331,7 @@ func (x *entityStoreWatchServer) Send(m *EntityWatchResponse) error { return x.ServerStream.SendMsg(m) } -func _EntityStore_AdminWrite_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStore_AdminWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AdminWriteEntityRequest) if err := dec(in); err != nil { return nil, err @@ -331,9 +341,9 @@ func _EntityStore_AdminWrite_Handler(srv any, ctx context.Context, dec func(any) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStore/AdminWrite", + FullMethod: EntityStore_AdminWrite_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreServer).AdminWrite(ctx, req.(*AdminWriteEntityRequest)) } return interceptor(ctx, in, info, handler) @@ -385,6 +395,10 @@ var EntityStore_ServiceDesc = grpc.ServiceDesc{ Metadata: "entity.proto", } +const ( + EntityStoreAdmin_AdminWrite_FullMethodName = "/entity.EntityStoreAdmin/AdminWrite" +) + // EntityStoreAdminClient is the client API for EntityStoreAdmin service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -402,7 +416,7 @@ func NewEntityStoreAdminClient(cc grpc.ClientConnInterface) EntityStoreAdminClie func (c *entityStoreAdminClient) AdminWrite(ctx context.Context, in *AdminWriteEntityRequest, opts ...grpc.CallOption) (*WriteEntityResponse, error) { out := new(WriteEntityResponse) - err := c.cc.Invoke(ctx, "/entity.EntityStoreAdmin/AdminWrite", in, out, opts...) + err := c.cc.Invoke(ctx, EntityStoreAdmin_AdminWrite_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -435,7 +449,7 @@ func RegisterEntityStoreAdminServer(s grpc.ServiceRegistrar, srv EntityStoreAdmi s.RegisterService(&EntityStoreAdmin_ServiceDesc, srv) } -func _EntityStoreAdmin_AdminWrite_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _EntityStoreAdmin_AdminWrite_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AdminWriteEntityRequest) if err := dec(in); err != nil { return nil, err @@ -445,9 +459,9 @@ func _EntityStoreAdmin_AdminWrite_Handler(srv any, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/entity.EntityStoreAdmin/AdminWrite", + FullMethod: EntityStoreAdmin_AdminWrite_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(EntityStoreAdminServer).AdminWrite(ctx, req.(*AdminWriteEntityRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/services/store/entity/generate.sh b/pkg/services/store/entity/generate.sh index 67b865ac9c2..378ff5915f7 100755 --- a/pkg/services/store/entity/generate.sh +++ b/pkg/services/store/entity/generate.sh @@ -1,11 +1,10 @@ #!/bin/bash # To compile all protobuf files in this repository, run -# "mage protobuf" at the top-level. +# "make protobuf" at the top-level. set -eu -#DST_DIR=../genproto/entity DST_DIR=./ SOURCE="${BASH_SOURCE[0]}" @@ -14,8 +13,12 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" cd "$DIR" -protoc -I ./ \ +protoc \ + -I ./ \ + -I ../../../../ \ --go_out=${DST_DIR} \ - --go-grpc_out=${DST_DIR} --go-grpc_opt=require_unimplemented_servers=false \ - entity.proto - \ No newline at end of file + --go_opt=paths=source_relative \ + --go-grpc_out=${DST_DIR} \ + --go-grpc_opt=paths=source_relative \ + --go-grpc_opt=require_unimplemented_servers=false \ + *.proto diff --git a/pkg/services/store/entity/grn.go b/pkg/services/store/entity/grn.go deleted file mode 100644 index 8b336cd3c21..00000000000 --- a/pkg/services/store/entity/grn.go +++ /dev/null @@ -1,21 +0,0 @@ -package entity - -import ( - "fmt" -) - -// Check if the two GRNs reference to the same object -// we can not use simple `*x == *b` because of the internal settings -func (x *GRN) Equals(b *GRN) bool { - if b == nil { - return false - } - return x == b || (x.TenantId == b.TenantId && - x.Kind == b.Kind && - x.UID == b.UID) -} - -// Set an OID based on the GRN -func (x *GRN) ToGRNString() string { - return fmt.Sprintf("grn:%d/%s/%s", x.TenantId, x.Kind, x.UID) -} diff --git a/pkg/services/store/entity/httpentitystore/service.go b/pkg/services/store/entity/httpentitystore/service.go index 4fe1daee5e9..00aa7c99a83 100644 --- a/pkg/services/store/entity/httpentitystore/service.go +++ b/pkg/services/store/entity/httpentitystore/service.go @@ -10,6 +10,7 @@ import ( "github.com/grafana/grafana/pkg/api/response" "github.com/grafana/grafana/pkg/api/routing" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/middleware" contextmodel "github.com/grafana/grafana/pkg/services/contexthandler/model" @@ -59,7 +60,7 @@ func (s *httpEntityStore) RegisterHTTPRoutes(route routing.RouteRegister) { // This function will extract UID+Kind from the requested path "*" in our router // This is far from ideal! but is at least consistent for these endpoints. // This will quickly be revisited as we explore how to encode UID+Kind in a "GRN" format -func (s *httpEntityStore) getGRNFromRequest(c *contextmodel.ReqContext) (*entity.GRN, map[string]string, error) { +func (s *httpEntityStore) getGRNFromRequest(c *contextmodel.ReqContext) (*grn.GRN, map[string]string, error) { params := web.Params(c.Req) // Read parameters that are encoded in the URL vals := c.Req.URL.Query() @@ -68,10 +69,10 @@ func (s *httpEntityStore) getGRNFromRequest(c *contextmodel.ReqContext) (*entity params[k] = v[0] } } - return &entity.GRN{ - TenantId: c.OrgID, - Kind: params[":kind"], - UID: params[":uid"], + return &grn.GRN{ + TenantID: c.OrgID, + ResourceKind: params[":kind"], + ResourceIdentifier: params[":uid"], }, params, nil } @@ -124,7 +125,7 @@ func (s *httpEntityStore) doGetRawEntity(c *contextmodel.ReqContext) response.Re if err != nil { return response.Error(500, "?", err) } - info, err := s.kinds.GetInfo(grn.Kind) + info, err := s.kinds.GetInfo(grn.ResourceKind) if err != nil { return response.Error(400, "Unsupported kind", err) } @@ -263,10 +264,10 @@ func (s *httpEntityStore) doUpload(c *contextmodel.ReqContext) response.Response return response.Error(500, "Internal Server Error", err) } - grn := &entity.GRN{ - UID: uid, - Kind: kind.ID, - TenantId: c.OrgID, + grn := &grn.GRN{ + ResourceIdentifier: uid, + ResourceKind: kind.ID, + TenantID: c.OrgID, } if !overwriteExistingFile { diff --git a/pkg/services/store/entity/json.go b/pkg/services/store/entity/json.go index 1c0d4e67d2a..b79724dc809 100644 --- a/pkg/services/store/entity/json.go +++ b/pkg/services/store/entity/json.go @@ -7,6 +7,8 @@ import ( "unsafe" jsoniter "github.com/json-iterator/go" + + "github.com/grafana/grafana/pkg/infra/grn" ) func init() { //nolint:gochecknoinits @@ -128,7 +130,7 @@ func readEntity(iter *jsoniter.Iterator, raw *Entity) { for l1Field := iter.ReadObject(); l1Field != ""; l1Field = iter.ReadObject() { switch l1Field { case "GRN": - raw.GRN = &GRN{} + raw.GRN = &grn.GRN{} iter.ReadVal(raw.GRN) case "updatedAt": raw.UpdatedAt = iter.ReadInt64() diff --git a/pkg/services/store/entity/json_test.go b/pkg/services/store/entity/json_test.go index f70fdbed85d..3e684f75e70 100644 --- a/pkg/services/store/entity/json_test.go +++ b/pkg/services/store/entity/json_test.go @@ -5,6 +5,8 @@ import ( "testing" "github.com/stretchr/testify/require" + + "github.com/grafana/grafana/pkg/infra/grn" ) func TestRawEncoders(t *testing.T) { @@ -15,9 +17,9 @@ func TestRawEncoders(t *testing.T) { require.NoError(t, err) raw := &Entity{ - GRN: &GRN{ - UID: "a", - Kind: "b", + GRN: &grn.GRN{ + ResourceIdentifier: "a", + ResourceKind: "b", }, Version: "c", ETag: "d", @@ -31,8 +33,8 @@ func TestRawEncoders(t *testing.T) { require.JSONEq(t, `{ "GRN": { - "kind": "b", - "UID": "a" + "ResourceKind": "b", + "ResourceIdentifier": "a" }, "version": "c", "body": { diff --git a/pkg/services/store/entity/sqlstash/folder_support.go b/pkg/services/store/entity/sqlstash/folder_support.go index 0e383bb8af6..2d642422b58 100644 --- a/pkg/services/store/entity/sqlstash/folder_support.go +++ b/pkg/services/store/entity/sqlstash/folder_support.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/services/sqlstore/session" "github.com/grafana/grafana/pkg/services/store/entity" ) @@ -140,12 +141,12 @@ func setMPTTOrder(folder *folderInfo, stack []*folderInfo, idx int32) (int32, er func insertFolderInfo(ctx context.Context, tx *session.SessionTx, tenant int64, folder *folderInfo, isDetached bool) error { js, _ := json.Marshal(folder.stack) - grn := entity.GRN{TenantId: tenant, Kind: entity.StandardKindFolder, UID: folder.UID} + grn2 := grn.GRN{TenantID: tenant, ResourceKind: entity.StandardKindFolder, ResourceIdentifier: folder.UID} _, err := tx.Exec(ctx, `INSERT INTO entity_folder `+ "(grn, tenant_id, uid, slug_path, tree, depth, left, right, detached) "+ `VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, - grn.ToGRNString(), + grn2.ToGRNString(), tenant, folder.UID, folder.Slug, diff --git a/pkg/services/store/entity/sqlstash/sql_storage_server.go b/pkg/services/store/entity/sqlstash/sql_storage_server.go index 388c008899e..343a444b937 100644 --- a/pkg/services/store/entity/sqlstash/sql_storage_server.go +++ b/pkg/services/store/entity/sqlstash/sql_storage_server.go @@ -11,6 +11,7 @@ import ( "github.com/grafana/grafana/pkg/infra/appcontext" "github.com/grafana/grafana/pkg/infra/db" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/slugify" "github.com/grafana/grafana/pkg/services/grpcserver" @@ -63,13 +64,13 @@ func getReadSelect(r *entity.ReadEntityRequest) string { func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql.Rows, r *entity.ReadEntityRequest) (*entity.Entity, error) { raw := &entity.Entity{ - GRN: &entity.GRN{}, + GRN: &grn.GRN{}, Origin: &entity.EntityOriginInfo{}, } summaryjson := &summarySupport{} args := []any{ - &raw.GRN.TenantId, &raw.GRN.Kind, &raw.GRN.UID, &raw.Folder, + &raw.GRN.TenantID, &raw.GRN.ResourceKind, &raw.GRN.ResourceIdentifier, &raw.Folder, &raw.Version, &raw.Size, &raw.ETag, &summaryjson.errors, &raw.CreatedAt, &raw.CreatedBy, &raw.UpdatedAt, &raw.UpdatedBy, @@ -106,7 +107,7 @@ func (s *sqlEntityServer) rowToReadEntityResponse(ctx context.Context, rows *sql return raw, nil } -func (s *sqlEntityServer) validateGRN(ctx context.Context, grn *entity.GRN) (*entity.GRN, error) { +func (s *sqlEntityServer) validateGRN(ctx context.Context, grn *grn.GRN) (*grn.GRN, error) { if grn == nil { return nil, fmt.Errorf("missing GRN") } @@ -114,22 +115,22 @@ func (s *sqlEntityServer) validateGRN(ctx context.Context, grn *entity.GRN) (*en if err != nil { return nil, err } - if grn.TenantId == 0 { - grn.TenantId = user.OrgID - } else if grn.TenantId != user.OrgID { + if grn.TenantID == 0 { + grn.TenantID = user.OrgID + } else if grn.TenantID != user.OrgID { return nil, fmt.Errorf("tenant ID does not match userID") } - if grn.Kind == "" { - return nil, fmt.Errorf("GRN missing kind") + if grn.ResourceKind == "" { + return nil, fmt.Errorf("GRN missing ResourceKind") } - if grn.UID == "" { - return nil, fmt.Errorf("GRN missing UID") + if grn.ResourceIdentifier == "" { + return nil, fmt.Errorf("GRN missing ResourceIdentifier") } - if len(grn.UID) > 40 { - return nil, fmt.Errorf("GRN UID is too long (>40)") + if len(grn.ResourceIdentifier) > 64 { + return nil, fmt.Errorf("GRN ResourceIdentifier is too long (>64)") } - if strings.ContainsAny(grn.UID, "/#$@?") { + if strings.ContainsAny(grn.ResourceIdentifier, "/#$@?") { return nil, fmt.Errorf("invalid character in GRN") } return grn, nil @@ -199,9 +200,9 @@ func (s *sqlEntityServer) readFromHistory(ctx context.Context, r *entity.ReadEnt // Dynamically create the summary if r.WithSummary { - builder := s.kinds.GetSummaryBuilder(r.GRN.Kind) + builder := s.kinds.GetSummaryBuilder(r.GRN.ResourceKind) if builder != nil { - val, out, err := builder(ctx, r.GRN.UID, raw.Body) + val, out, err := builder(ctx, r.GRN.ResourceIdentifier, raw.Body) if err == nil { raw.Body = out // cleaned up raw.SummaryJson, err = json.Marshal(val) @@ -438,7 +439,7 @@ func (s *sqlEntityServer) AdminWrite(ctx context.Context, r *entity.AdminWriteEn " ?, ?, ?, "+ " ?, ?, ?, "+ " ?, ?, ?)", - oid, grn.TenantId, grn.Kind, grn.UID, r.Folder, + oid, grn.TenantID, grn.ResourceKind, grn.ResourceIdentifier, r.Folder, versionInfo.Size, body, etag, versionInfo.Version, updatedAt, createdBy, createdAt, createdBy, summary.model.Name, summary.model.Description, summary.model.Slug, @@ -446,8 +447,8 @@ func (s *sqlEntityServer) AdminWrite(ctx context.Context, r *entity.AdminWriteEn origin.Source, origin.Key, origin.Time, ) } - if err == nil && entity.StandardKindFolder == r.GRN.Kind { - err = updateFolderTree(ctx, tx, grn.TenantId) + if err == nil && entity.StandardKindFolder == r.GRN.ResourceKind { + err = updateFolderTree(ctx, tx, grn.TenantID) } if err == nil { summary.folder = r.Folder @@ -514,7 +515,7 @@ func (s *sqlEntityServer) selectForUpdate(ctx context.Context, tx *session.Sessi func (s *sqlEntityServer) writeSearchInfo( ctx context.Context, tx *session.SessionTx, - grn string, + grn2 string, summary *summarySupport, ) error { parent_grn := summary.getParentGRN() @@ -525,7 +526,7 @@ func (s *sqlEntityServer) writeSearchInfo( `INSERT INTO entity_labels `+ "(grn, label, value, parent_grn) "+ `VALUES (?, ?, ?, ?)`, - grn, k, v, parent_grn, + grn2, k, v, parent_grn, ) if err != nil { return err @@ -542,7 +543,7 @@ func (s *sqlEntityServer) writeSearchInfo( "grn, parent_grn, family, type, id, "+ "resolved_ok, resolved_to, resolved_warning, resolved_time) "+ `VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, - grn, parent_grn, ref.Family, ref.Type, ref.Identifier, + grn2, parent_grn, ref.Family, ref.Type, ref.Identifier, resolved.OK, resolved.Key, resolved.Warning, resolved.Timestamp, ) if err != nil { @@ -553,10 +554,10 @@ func (s *sqlEntityServer) writeSearchInfo( // Traverse entities and insert refs if summary.model.Nested != nil { for _, childModel := range summary.model.Nested { - grn = (&entity.GRN{ - TenantId: summary.parent_grn.TenantId, - Kind: childModel.Kind, - UID: childModel.UID, // append??? + grn2 = (&grn.GRN{ + TenantID: summary.parent_grn.TenantID, + ResourceKind: childModel.Kind, + ResourceIdentifier: childModel.UID, // append??? }).ToGRNString() child, err := newSummarySupport(childModel) @@ -577,17 +578,16 @@ func (s *sqlEntityServer) writeSearchInfo( " ?, ?, ?, ?,"+ " ?, ?,"+ " ?, ?, ?)", - *parent_grn, grn, - summary.parent_grn.TenantId, childModel.Kind, childModel.UID, summary.folder, + *parent_grn, grn2, + summary.parent_grn.TenantID, childModel.Kind, childModel.UID, summary.folder, child.name, child.description, child.labels, child.fields, child.errors, ) - if err != nil { return err } - err = s.writeSearchInfo(ctx, tx, grn, child) + err = s.writeSearchInfo(ctx, tx, grn2, child) if err != nil { return err } @@ -598,13 +598,12 @@ func (s *sqlEntityServer) writeSearchInfo( } func (s *sqlEntityServer) prepare(ctx context.Context, r *entity.AdminWriteEntityRequest) (*summarySupport, []byte, error) { - grn := r.GRN - builder := s.kinds.GetSummaryBuilder(grn.Kind) + builder := s.kinds.GetSummaryBuilder(r.GRN.ResourceKind) if builder == nil { return nil, nil, fmt.Errorf("unsupported kind") } - summary, body, err := builder(ctx, grn.UID, r.Body) + summary, body, err := builder(ctx, r.GRN.ResourceIdentifier, r.Body) if err != nil { return nil, nil, err } @@ -613,7 +612,7 @@ func (s *sqlEntityServer) prepare(ctx context.Context, r *entity.AdminWriteEntit if summary.Slug == "" { t := summary.Name if t == "" { - t = r.GRN.UID + t = r.GRN.ResourceIdentifier } summary.Slug = slugify.Slugify(t) } @@ -627,21 +626,21 @@ func (s *sqlEntityServer) prepare(ctx context.Context, r *entity.AdminWriteEntit } func (s *sqlEntityServer) Delete(ctx context.Context, r *entity.DeleteEntityRequest) (*entity.DeleteEntityResponse, error) { - grn, err := s.validateGRN(ctx, r.GRN) + grn2, err := s.validateGRN(ctx, r.GRN) if err != nil { return nil, err } rsp := &entity.DeleteEntityResponse{} err = s.sess.WithTransaction(ctx, func(tx *session.SessionTx) error { - rsp.OK, err = doDelete(ctx, tx, grn) + rsp.OK, err = doDelete(ctx, tx, grn2) return err }) return rsp, err } -func doDelete(ctx context.Context, tx *session.SessionTx, grn *entity.GRN) (bool, error) { - str := grn.ToGRNString() +func doDelete(ctx context.Context, tx *session.SessionTx, grn2 *grn.GRN) (bool, error) { + str := grn2.ToGRNString() results, err := tx.Exec(ctx, "DELETE FROM entity WHERE grn=?", str) if err != nil { return false, err @@ -669,18 +668,18 @@ func doDelete(ctx context.Context, tx *session.SessionTx, grn *entity.GRN) (bool return false, err } - if grn.Kind == entity.StandardKindFolder { - err = updateFolderTree(ctx, tx, grn.TenantId) + if grn2.ResourceKind == entity.StandardKindFolder { + err = updateFolderTree(ctx, tx, grn2.TenantID) } return rows > 0, err } func (s *sqlEntityServer) History(ctx context.Context, r *entity.EntityHistoryRequest) (*entity.EntityHistoryResponse, error) { - grn, err := s.validateGRN(ctx, r.GRN) + grn2, err := s.validateGRN(ctx, r.GRN) if err != nil { return nil, err } - oid := grn.ToGRNString() + oid := grn2.ToGRNString() page := "" args := []any{oid} @@ -789,12 +788,12 @@ func (s *sqlEntityServer) Search(ctx context.Context, r *entity.EntitySearchRequ rsp := &entity.EntitySearchResponse{} for rows.Next() { result := &entity.EntitySearchResult{ - GRN: &entity.GRN{}, + GRN: &grn.GRN{}, } summaryjson := summarySupport{} args := []any{ - &oid, &result.GRN.TenantId, &result.GRN.Kind, &result.GRN.UID, + &oid, &result.GRN.TenantID, &result.GRN.ResourceKind, &result.GRN.ResourceIdentifier, &result.Version, &result.Folder, &result.Slug, &summaryjson.errors, &result.Size, &result.UpdatedAt, &result.UpdatedBy, &result.Name, &summaryjson.description, diff --git a/pkg/services/store/entity/sqlstash/summary_handler.go b/pkg/services/store/entity/sqlstash/summary_handler.go index 95c7b20b61f..3b597fe3026 100644 --- a/pkg/services/store/entity/sqlstash/summary_handler.go +++ b/pkg/services/store/entity/sqlstash/summary_handler.go @@ -3,6 +3,7 @@ package sqlstash import ( "encoding/json" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/services/store/entity" ) @@ -17,7 +18,7 @@ type summarySupport struct { marshaled []byte // metadata for nested objects - parent_grn *entity.GRN + parent_grn *grn.GRN folder string isNested bool // set when this is for a nested item } diff --git a/pkg/services/store/entity/tests/server_integration_test.go b/pkg/services/store/entity/tests/server_integration_test.go index 0fab91445fc..b6c365e9ad2 100644 --- a/pkg/services/store/entity/tests/server_integration_test.go +++ b/pkg/services/store/entity/tests/server_integration_test.go @@ -11,6 +11,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc/metadata" + "github.com/grafana/grafana/pkg/infra/grn" "github.com/grafana/grafana/pkg/services/store" "github.com/grafana/grafana/pkg/services/store/entity" "github.com/grafana/grafana/pkg/util" @@ -24,7 +25,7 @@ var ( ) type rawEntityMatcher struct { - grn *entity.GRN + grn *grn.GRN createdRange []time.Time updatedRange []time.Time createdBy string @@ -53,14 +54,14 @@ func requireEntityMatch(t *testing.T, obj *entity.Entity, m rawEntityMatcher) { mismatches := "" if m.grn != nil { - if m.grn.TenantId > 0 && m.grn.TenantId != obj.GRN.TenantId { - mismatches += fmt.Sprintf("expected tenant: %d, actual: %d\n", m.grn.TenantId, obj.GRN.TenantId) + if m.grn.TenantID > 0 && m.grn.TenantID != obj.GRN.TenantID { + mismatches += fmt.Sprintf("expected tenant: %d, actual: %d\n", m.grn.TenantID, obj.GRN.TenantID) } - if m.grn.Kind != "" && m.grn.Kind != obj.GRN.Kind { - mismatches += fmt.Sprintf("expected Kind: %s, actual: %s\n", m.grn.Kind, obj.GRN.Kind) + if m.grn.ResourceKind != "" && m.grn.ResourceKind != obj.GRN.ResourceKind { + mismatches += fmt.Sprintf("expected ResourceKind: %s, actual: %s\n", m.grn.ResourceKind, obj.GRN.ResourceKind) } - if m.grn.UID != "" && m.grn.UID != obj.GRN.UID { - mismatches += fmt.Sprintf("expected UID: %s, actual: %s\n", m.grn.UID, obj.GRN.UID) + if m.grn.ResourceIdentifier != "" && m.grn.ResourceIdentifier != obj.GRN.ResourceIdentifier { + mismatches += fmt.Sprintf("expected ResourceIdentifier: %s, actual: %s\n", m.grn.ResourceIdentifier, obj.GRN.ResourceIdentifier) } } @@ -134,15 +135,15 @@ func TestIntegrationEntityServer(t *testing.T) { fakeUser := store.GetUserIDString(testCtx.user) firstVersion := "1" kind := entity.StandardKindJSONObj - grn := &entity.GRN{ - Kind: kind, - UID: "my-test-entity", + testGrn := &grn.GRN{ + ResourceKind: kind, + ResourceIdentifier: "my-test-entity", } body := []byte("{\"name\":\"John\"}") t.Run("should not retrieve non-existent objects", func(t *testing.T) { resp, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ - GRN: grn, + GRN: testGrn, }) require.NoError(t, err) @@ -153,7 +154,7 @@ func TestIntegrationEntityServer(t *testing.T) { t.Run("should be able to read persisted objects", func(t *testing.T) { before := time.Now() writeReq := &entity.WriteEntityRequest{ - GRN: grn, + GRN: testGrn, Body: body, Comment: "first entity!", } @@ -169,7 +170,7 @@ func TestIntegrationEntityServer(t *testing.T) { requireVersionMatch(t, writeResp.Entity, versionMatcher) readResp, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ - GRN: grn, + GRN: testGrn, Version: "", WithBody: true, }) @@ -179,12 +180,12 @@ func TestIntegrationEntityServer(t *testing.T) { foundGRN := readResp.GRN require.NotNil(t, foundGRN) - require.Equal(t, testCtx.user.OrgID, foundGRN.TenantId) // orgId becomes the tenant id when not set - require.Equal(t, grn.Kind, foundGRN.Kind) - require.Equal(t, grn.UID, foundGRN.UID) + require.Equal(t, testCtx.user.OrgID, foundGRN.TenantID) // orgId becomes the tenant id when not set + require.Equal(t, testGrn.ResourceKind, foundGRN.ResourceKind) + require.Equal(t, testGrn.ResourceIdentifier, foundGRN.ResourceIdentifier) objectMatcher := rawEntityMatcher{ - grn: grn, + grn: testGrn, createdRange: []time.Time{before, time.Now()}, updatedRange: []time.Time{before, time.Now()}, createdBy: fakeUser, @@ -195,14 +196,14 @@ func TestIntegrationEntityServer(t *testing.T) { requireEntityMatch(t, readResp, objectMatcher) deleteResp, err := testCtx.client.Delete(ctx, &entity.DeleteEntityRequest{ - GRN: grn, + GRN: testGrn, PreviousVersion: writeResp.Entity.Version, }) require.NoError(t, err) require.True(t, deleteResp.OK) readRespAfterDelete, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ - GRN: grn, + GRN: testGrn, Version: "", WithBody: true, }) @@ -212,13 +213,13 @@ func TestIntegrationEntityServer(t *testing.T) { t.Run("should be able to update an object", func(t *testing.T) { before := time.Now() - grn := &entity.GRN{ - Kind: kind, - UID: util.GenerateShortUID(), + testGrn := &grn.GRN{ + ResourceKind: kind, + ResourceIdentifier: util.GenerateShortUID(), } writeReq1 := &entity.WriteEntityRequest{ - GRN: grn, + GRN: testGrn, Body: body, Comment: "first entity!", } @@ -229,7 +230,7 @@ func TestIntegrationEntityServer(t *testing.T) { body2 := []byte("{\"name\":\"John2\"}") writeReq2 := &entity.WriteEntityRequest{ - GRN: grn, + GRN: testGrn, Body: body2, Comment: "update1", } @@ -247,7 +248,7 @@ func TestIntegrationEntityServer(t *testing.T) { body3 := []byte("{\"name\":\"John3\"}") writeReq3 := &entity.WriteEntityRequest{ - GRN: grn, + GRN: testGrn, Body: body3, Comment: "update3", } @@ -256,7 +257,7 @@ func TestIntegrationEntityServer(t *testing.T) { require.NotEqual(t, writeResp3.Entity.Version, writeResp2.Entity.Version) latestMatcher := rawEntityMatcher{ - grn: grn, + grn: testGrn, createdRange: []time.Time{before, time.Now()}, updatedRange: []time.Time{before, time.Now()}, createdBy: fakeUser, @@ -265,7 +266,7 @@ func TestIntegrationEntityServer(t *testing.T) { version: &writeResp3.Entity.Version, } readRespLatest, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ - GRN: grn, + GRN: testGrn, Version: "", // latest WithBody: true, }) @@ -274,7 +275,7 @@ func TestIntegrationEntityServer(t *testing.T) { requireEntityMatch(t, readRespLatest, latestMatcher) readRespFirstVer, err := testCtx.client.Read(ctx, &entity.ReadEntityRequest{ - GRN: grn, + GRN: testGrn, Version: writeResp1.Entity.Version, WithBody: true, }) @@ -283,7 +284,7 @@ func TestIntegrationEntityServer(t *testing.T) { require.Nil(t, readRespFirstVer.SummaryJson) require.NotNil(t, readRespFirstVer) requireEntityMatch(t, readRespFirstVer, rawEntityMatcher{ - grn: grn, + grn: testGrn, createdRange: []time.Time{before, time.Now()}, updatedRange: []time.Time{before, time.Now()}, createdBy: fakeUser, @@ -293,7 +294,7 @@ func TestIntegrationEntityServer(t *testing.T) { }) history, err := testCtx.client.History(ctx, &entity.EntityHistoryRequest{ - GRN: grn, + GRN: testGrn, }) require.NoError(t, err) require.Equal(t, []*entity.EntityVersionInfo{ @@ -303,7 +304,7 @@ func TestIntegrationEntityServer(t *testing.T) { }, history.Versions) deleteResp, err := testCtx.client.Delete(ctx, &entity.DeleteEntityRequest{ - GRN: grn, + GRN: testGrn, PreviousVersion: writeResp3.Entity.Version, }) require.NoError(t, err) @@ -316,33 +317,33 @@ func TestIntegrationEntityServer(t *testing.T) { uid4 := "uid4" kind2 := entity.StandardKindPlaylist w1, err := testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: grn, + GRN: testGrn, Body: body, }) require.NoError(t, err) w2, err := testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - UID: uid2, - Kind: kind, + GRN: &grn.GRN{ + ResourceIdentifier: uid2, + ResourceKind: kind, }, Body: body, }) require.NoError(t, err) w3, err := testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - UID: uid3, - Kind: kind2, + GRN: &grn.GRN{ + ResourceIdentifier: uid3, + ResourceKind: kind2, }, Body: body, }) require.NoError(t, err) w4, err := testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - UID: uid4, - Kind: kind2, + GRN: &grn.GRN{ + ResourceIdentifier: uid4, + ResourceKind: kind2, }, Body: body, }) @@ -359,8 +360,8 @@ func TestIntegrationEntityServer(t *testing.T) { kinds := make([]string, 0, len(search.Results)) version := make([]string, 0, len(search.Results)) for _, res := range search.Results { - uids = append(uids, res.GRN.UID) - kinds = append(kinds, res.GRN.Kind) + uids = append(uids, res.GRN.ResourceIdentifier) + kinds = append(kinds, res.GRN.ResourceKind) version = append(version, res.Version) } require.Equal(t, []string{"my-test-entity", "uid2", "uid3", "uid4"}, uids) @@ -381,8 +382,8 @@ func TestIntegrationEntityServer(t *testing.T) { kinds = make([]string, 0, len(searchKind1.Results)) version = make([]string, 0, len(searchKind1.Results)) for _, res := range searchKind1.Results { - uids = append(uids, res.GRN.UID) - kinds = append(kinds, res.GRN.Kind) + uids = append(uids, res.GRN.ResourceIdentifier) + kinds = append(kinds, res.GRN.ResourceKind) version = append(version, res.Version) } require.Equal(t, []string{"my-test-entity", "uid2"}, uids) @@ -396,18 +397,18 @@ func TestIntegrationEntityServer(t *testing.T) { t.Run("should be able to filter objects based on their labels", func(t *testing.T) { kind := entity.StandardKindDashboard _, err := testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - Kind: kind, - UID: "blue-green", + GRN: &grn.GRN{ + ResourceKind: kind, + ResourceIdentifier: "blue-green", }, Body: []byte(dashboardWithTagsBlueGreen), }) require.NoError(t, err) _, err = testCtx.client.Write(ctx, &entity.WriteEntityRequest{ - GRN: &entity.GRN{ - Kind: kind, - UID: "red-green", + GRN: &grn.GRN{ + ResourceKind: kind, + ResourceIdentifier: "red-green", }, Body: []byte(dashboardWithTagsRedGreen), }) @@ -424,7 +425,7 @@ func TestIntegrationEntityServer(t *testing.T) { require.NoError(t, err) require.NotNil(t, search) require.Len(t, search.Results, 1) - require.Equal(t, search.Results[0].GRN.UID, "red-green") + require.Equal(t, search.Results[0].GRN.ResourceIdentifier, "red-green") search, err = testCtx.client.Search(ctx, &entity.EntitySearchRequest{ Kind: []string{kind}, @@ -438,7 +439,7 @@ func TestIntegrationEntityServer(t *testing.T) { require.NoError(t, err) require.NotNil(t, search) require.Len(t, search.Results, 1) - require.Equal(t, search.Results[0].GRN.UID, "red-green") + require.Equal(t, search.Results[0].GRN.ResourceIdentifier, "red-green") search, err = testCtx.client.Search(ctx, &entity.EntitySearchRequest{ Kind: []string{kind},