From 921d438d8fc29361cf1e9bc08180e45f485c1f53 Mon Sep 17 00:00:00 2001 From: Aleksandr Tarasov Date: Tue, 14 Nov 2023 14:42:45 +0300 Subject: [PATCH] Add Module's Dependencies (#8) * add module dependencies * re-organize files --- Makefile | 4 +- api/pbuf-registry/v1/entities.proto | 35 ++ api/{ => pbuf-registry}/v1/registry.proto | 50 +- cmd/main.go | 2 +- gen/pbuf-registry/v1/entities.pb.go | 315 ++++++++++ gen/pbuf-registry/v1/entities.swagger.json | 44 ++ gen/{ => pbuf-registry}/v1/registry.pb.go | 562 +++++++++--------- gen/{ => pbuf-registry}/v1/registry.pb.gw.go | 313 +++++----- .../v1/registry.swagger.json | 226 +++++-- .../v1/registry_grpc.pb.go | 57 +- internal/data/registry.go | 129 +++- internal/data/registry_test.go | 123 +++- internal/mocks/registry_repository.go | 42 +- internal/server/registry.go | 29 +- internal/server/registry_test.go | 2 +- internal/utils/checkers.go | 2 +- internal/utils/checkers_test.go | 2 +- migrations/20231105143113_modules.sql | 7 +- migrations/20231113161248_add_timestamp.sql | 23 + migrations/20231113161748_dependencies.sql | 17 + 20 files changed, 1446 insertions(+), 538 deletions(-) create mode 100644 api/pbuf-registry/v1/entities.proto rename api/{ => pbuf-registry}/v1/registry.proto (80%) create mode 100644 gen/pbuf-registry/v1/entities.pb.go create mode 100644 gen/pbuf-registry/v1/entities.swagger.json rename gen/{ => pbuf-registry}/v1/registry.pb.go (51%) rename gen/{ => pbuf-registry}/v1/registry.pb.gw.go (76%) rename gen/{ => pbuf-registry}/v1/registry.swagger.json (67%) rename gen/{ => pbuf-registry}/v1/registry_grpc.pb.go (83%) create mode 100644 migrations/20231113161248_add_timestamp.sql create mode 100644 migrations/20231113161748_dependencies.sql diff --git a/Makefile b/Makefile index 54ff71b..f8dbeb6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -API_PATH=api/v1 +API_PATH=api/pbuf-registry REGISTRY_VERSION?=latest .PHONY: vendor @@ -9,7 +9,7 @@ vendor: .PHONY: vendor-gen # gen modules vendor-gen: - buf generate --template buf.modules.gen.yaml --exclude-path ${API_PATH} + buf generate --template buf.modules.gen.yaml --exclude-path ${API_PATH} --exclude-path third_party/google .PHONY: vendor-all vendor-all: diff --git a/api/pbuf-registry/v1/entities.proto b/api/pbuf-registry/v1/entities.proto new file mode 100644 index 0000000..5b19e46 --- /dev/null +++ b/api/pbuf-registry/v1/entities.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package pbufregistry.v1; + +option go_package = "pbufregistry/api/v1;v1"; + +// Module is a module registered in the registry. +message Module { + // id is the unique identifier of the module. + string id = 1; + + // The name of the module. + string name = 2; + + // The tags of the module. + repeated string tags = 3; +} + +// ProtoFile is a proto file registered in the registry. +message ProtoFile { + // The filename of the proto file. + string filename = 1; + + // The content of the proto file. + string content = 2; +} + +// Dependency is a dependency registered in the registry. +message Dependency { + // The name of the dependency. + string name = 1; + + // The tag of the dependency. + string tag = 2; +} \ No newline at end of file diff --git a/api/v1/registry.proto b/api/pbuf-registry/v1/registry.proto similarity index 80% rename from api/v1/registry.proto rename to api/pbuf-registry/v1/registry.proto index c84ca1d..f6753d0 100644 --- a/api/v1/registry.proto +++ b/api/pbuf-registry/v1/registry.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package pbufregistry.v1; import "google/api/annotations.proto"; +import "pbuf-registry/v1/entities.proto"; option go_package = "pbufregistry/api/v1;v1"; @@ -18,7 +19,8 @@ service Registry { // Get a module by name rpc GetModule(GetModuleRequest) returns (Module) { option (google.api.http) = { - get: "/v1/modules/{name}" + post: "/v1/modules/get" + body: "*" }; } @@ -33,7 +35,8 @@ service Registry { // Pull a module tag rpc PullModule(PullModuleRequest) returns (PullModuleResponse) { option (google.api.http) = { - get: "/v1/modules/{name}/tags/{tag}" + post: "/v1/modules/pull" + body: "*" }; } @@ -48,14 +51,24 @@ service Registry { // Delete a module by name rpc DeleteModule(DeleteModuleRequest) returns (DeleteModuleResponse) { option (google.api.http) = { - delete: "/v1/modules/{name}" + post: "/v1/modules/delete" + body: "*" }; } // Delete a specific module tag rpc DeleteModuleTag(DeleteModuleTagRequest) returns (DeleteModuleTagResponse) { option (google.api.http) = { - delete: "/v1/modules/{name}/tags/{tag}" + post: "/v1/modules/tags/delete" + body: "*" + }; + } + + // Get Module Dependencies + rpc GetModuleDependencies(GetModuleDependenciesRequest) returns (GetModuleDependenciesResponse) { + option (google.api.http) = { + post: "/v1/modules/dependencies" + body: "*" }; } } @@ -126,6 +139,9 @@ message PushModuleRequest { // Protofiles repeated ProtoFile protofiles = 3; + + // Dependencies + repeated Dependency dependencies = 4; } // DeleteModuleRequest is the request message for DeleteModule. @@ -158,23 +174,17 @@ message DeleteModuleTagResponse { string tag = 2; } -// Module is a module registered in the registry. -message Module { - // id is the unique identifier of the module. - string id = 1; - - // The name of the module. - string name = 2; +// GetModuleDependenciesRequest is the request message for GetModuleDependencies. +message GetModuleDependenciesRequest { + // The name of the module to retrieve + string name = 1; - // The tags of the module. - repeated string tags = 3; + // The tag of the module to retrieve + string tag = 2; } -// ProtoFile is a proto file registered in the registry. -message ProtoFile { - // The filename of the proto file. - string filename = 1; - - // The content of the proto file. - string content = 2; +// GetModuleDependenciesResponse is the response message for GetModuleDependencies. +message GetModuleDependenciesResponse { + // The dependencies of the module. + repeated Dependency dependencies = 1; } \ No newline at end of file diff --git a/cmd/main.go b/cmd/main.go index 52566f0..de4014b 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -8,7 +8,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "github.com/jackc/pgx/v5/pgxpool" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" "github.com/pbufio/pbuf-registry/internal/config" "github.com/pbufio/pbuf-registry/internal/data" "github.com/pbufio/pbuf-registry/internal/server" diff --git a/gen/pbuf-registry/v1/entities.pb.go b/gen/pbuf-registry/v1/entities.pb.go new file mode 100644 index 0000000..8566935 --- /dev/null +++ b/gen/pbuf-registry/v1/entities.pb.go @@ -0,0 +1,315 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: pbuf-registry/v1/entities.proto + +package v1 + +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) +) + +// Module is a module registered in the registry. +type Module struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the unique identifier of the module. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the module. + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // The tags of the module. + Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` +} + +func (x *Module) Reset() { + *x = Module{} + if protoimpl.UnsafeEnabled { + mi := &file_pbuf_registry_v1_entities_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Module) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Module) ProtoMessage() {} + +func (x *Module) ProtoReflect() protoreflect.Message { + mi := &file_pbuf_registry_v1_entities_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 Module.ProtoReflect.Descriptor instead. +func (*Module) Descriptor() ([]byte, []int) { + return file_pbuf_registry_v1_entities_proto_rawDescGZIP(), []int{0} +} + +func (x *Module) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *Module) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Module) GetTags() []string { + if x != nil { + return x.Tags + } + return nil +} + +// ProtoFile is a proto file registered in the registry. +type ProtoFile struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The filename of the proto file. + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` + // The content of the proto file. + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *ProtoFile) Reset() { + *x = ProtoFile{} + if protoimpl.UnsafeEnabled { + mi := &file_pbuf_registry_v1_entities_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProtoFile) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProtoFile) ProtoMessage() {} + +func (x *ProtoFile) ProtoReflect() protoreflect.Message { + mi := &file_pbuf_registry_v1_entities_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ProtoFile.ProtoReflect.Descriptor instead. +func (*ProtoFile) Descriptor() ([]byte, []int) { + return file_pbuf_registry_v1_entities_proto_rawDescGZIP(), []int{1} +} + +func (x *ProtoFile) GetFilename() string { + if x != nil { + return x.Filename + } + return "" +} + +func (x *ProtoFile) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +// Dependency is a dependency registered in the registry. +type Dependency struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the dependency. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The tag of the dependency. + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` +} + +func (x *Dependency) Reset() { + *x = Dependency{} + if protoimpl.UnsafeEnabled { + mi := &file_pbuf_registry_v1_entities_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Dependency) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Dependency) ProtoMessage() {} + +func (x *Dependency) ProtoReflect() protoreflect.Message { + mi := &file_pbuf_registry_v1_entities_proto_msgTypes[2] + 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 Dependency.ProtoReflect.Descriptor instead. +func (*Dependency) Descriptor() ([]byte, []int) { + return file_pbuf_registry_v1_entities_proto_rawDescGZIP(), []int{2} +} + +func (x *Dependency) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Dependency) GetTag() string { + if x != nil { + return x.Tag + } + return "" +} + +var File_pbuf_registry_v1_entities_proto protoreflect.FileDescriptor + +var file_pbuf_registry_v1_entities_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x62, 0x75, 0x66, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, + 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0f, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x22, 0x40, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x61, 0x67, 0x73, 0x22, 0x41, 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x32, 0x0a, 0x0a, 0x44, 0x65, 0x70, 0x65, 0x6e, + 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x42, 0x18, 0x5a, 0x16, 0x70, + 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pbuf_registry_v1_entities_proto_rawDescOnce sync.Once + file_pbuf_registry_v1_entities_proto_rawDescData = file_pbuf_registry_v1_entities_proto_rawDesc +) + +func file_pbuf_registry_v1_entities_proto_rawDescGZIP() []byte { + file_pbuf_registry_v1_entities_proto_rawDescOnce.Do(func() { + file_pbuf_registry_v1_entities_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbuf_registry_v1_entities_proto_rawDescData) + }) + return file_pbuf_registry_v1_entities_proto_rawDescData +} + +var file_pbuf_registry_v1_entities_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_pbuf_registry_v1_entities_proto_goTypes = []interface{}{ + (*Module)(nil), // 0: pbufregistry.v1.Module + (*ProtoFile)(nil), // 1: pbufregistry.v1.ProtoFile + (*Dependency)(nil), // 2: pbufregistry.v1.Dependency +} +var file_pbuf_registry_v1_entities_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_pbuf_registry_v1_entities_proto_init() } +func file_pbuf_registry_v1_entities_proto_init() { + if File_pbuf_registry_v1_entities_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pbuf_registry_v1_entities_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Module); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pbuf_registry_v1_entities_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProtoFile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pbuf_registry_v1_entities_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Dependency); 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_pbuf_registry_v1_entities_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pbuf_registry_v1_entities_proto_goTypes, + DependencyIndexes: file_pbuf_registry_v1_entities_proto_depIdxs, + MessageInfos: file_pbuf_registry_v1_entities_proto_msgTypes, + }.Build() + File_pbuf_registry_v1_entities_proto = out.File + file_pbuf_registry_v1_entities_proto_rawDesc = nil + file_pbuf_registry_v1_entities_proto_goTypes = nil + file_pbuf_registry_v1_entities_proto_depIdxs = nil +} diff --git a/gen/pbuf-registry/v1/entities.swagger.json b/gen/pbuf-registry/v1/entities.swagger.json new file mode 100644 index 0000000..9c82e03 --- /dev/null +++ b/gen/pbuf-registry/v1/entities.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "pbuf-registry/v1/entities.proto", + "version": "version not set" + }, + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + } + } +} diff --git a/gen/v1/registry.pb.go b/gen/pbuf-registry/v1/registry.pb.go similarity index 51% rename from gen/v1/registry.pb.go rename to gen/pbuf-registry/v1/registry.pb.go index 6601293..86d6048 100644 --- a/gen/v1/registry.pb.go +++ b/gen/pbuf-registry/v1/registry.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.31.0 // protoc (unknown) -// source: v1/registry.proto +// source: pbuf-registry/v1/registry.proto package v1 @@ -43,7 +43,7 @@ type ListModulesRequest struct { func (x *ListModulesRequest) Reset() { *x = ListModulesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[0] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -56,7 +56,7 @@ func (x *ListModulesRequest) String() string { func (*ListModulesRequest) ProtoMessage() {} func (x *ListModulesRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[0] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -69,7 +69,7 @@ func (x *ListModulesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListModulesRequest.ProtoReflect.Descriptor instead. func (*ListModulesRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{0} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{0} } func (x *ListModulesRequest) GetPageSize() int32 { @@ -102,7 +102,7 @@ type ListModulesResponse struct { func (x *ListModulesResponse) Reset() { *x = ListModulesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[1] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -115,7 +115,7 @@ func (x *ListModulesResponse) String() string { func (*ListModulesResponse) ProtoMessage() {} func (x *ListModulesResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[1] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -128,7 +128,7 @@ func (x *ListModulesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListModulesResponse.ProtoReflect.Descriptor instead. func (*ListModulesResponse) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{1} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{1} } func (x *ListModulesResponse) GetModules() []*Module { @@ -158,7 +158,7 @@ type GetModuleRequest struct { func (x *GetModuleRequest) Reset() { *x = GetModuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[2] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -171,7 +171,7 @@ func (x *GetModuleRequest) String() string { func (*GetModuleRequest) ProtoMessage() {} func (x *GetModuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[2] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -184,7 +184,7 @@ func (x *GetModuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetModuleRequest.ProtoReflect.Descriptor instead. func (*GetModuleRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{2} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{2} } func (x *GetModuleRequest) GetName() string { @@ -209,7 +209,7 @@ type PullModuleRequest struct { func (x *PullModuleRequest) Reset() { *x = PullModuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[3] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -222,7 +222,7 @@ func (x *PullModuleRequest) String() string { func (*PullModuleRequest) ProtoMessage() {} func (x *PullModuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[3] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -235,7 +235,7 @@ func (x *PullModuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PullModuleRequest.ProtoReflect.Descriptor instead. func (*PullModuleRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{3} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{3} } func (x *PullModuleRequest) GetName() string { @@ -267,7 +267,7 @@ type PullModuleResponse struct { func (x *PullModuleResponse) Reset() { *x = PullModuleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[4] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -280,7 +280,7 @@ func (x *PullModuleResponse) String() string { func (*PullModuleResponse) ProtoMessage() {} func (x *PullModuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[4] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -293,7 +293,7 @@ func (x *PullModuleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PullModuleResponse.ProtoReflect.Descriptor instead. func (*PullModuleResponse) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{4} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{4} } func (x *PullModuleResponse) GetModule() *Module { @@ -323,7 +323,7 @@ type RegisterModuleRequest struct { func (x *RegisterModuleRequest) Reset() { *x = RegisterModuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[5] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -336,7 +336,7 @@ func (x *RegisterModuleRequest) String() string { func (*RegisterModuleRequest) ProtoMessage() {} func (x *RegisterModuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[5] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -349,7 +349,7 @@ func (x *RegisterModuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RegisterModuleRequest.ProtoReflect.Descriptor instead. func (*RegisterModuleRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{5} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{5} } func (x *RegisterModuleRequest) GetName() string { @@ -371,12 +371,14 @@ type PushModuleRequest struct { Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` // Protofiles Protofiles []*ProtoFile `protobuf:"bytes,3,rep,name=protofiles,proto3" json:"protofiles,omitempty"` + // Dependencies + Dependencies []*Dependency `protobuf:"bytes,4,rep,name=dependencies,proto3" json:"dependencies,omitempty"` } func (x *PushModuleRequest) Reset() { *x = PushModuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[6] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -389,7 +391,7 @@ func (x *PushModuleRequest) String() string { func (*PushModuleRequest) ProtoMessage() {} func (x *PushModuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[6] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -402,7 +404,7 @@ func (x *PushModuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PushModuleRequest.ProtoReflect.Descriptor instead. func (*PushModuleRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{6} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{6} } func (x *PushModuleRequest) GetModuleName() string { @@ -426,6 +428,13 @@ func (x *PushModuleRequest) GetProtofiles() []*ProtoFile { return nil } +func (x *PushModuleRequest) GetDependencies() []*Dependency { + if x != nil { + return x.Dependencies + } + return nil +} + // DeleteModuleRequest is the request message for DeleteModule. type DeleteModuleRequest struct { state protoimpl.MessageState @@ -439,7 +448,7 @@ type DeleteModuleRequest struct { func (x *DeleteModuleRequest) Reset() { *x = DeleteModuleRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[7] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -452,7 +461,7 @@ func (x *DeleteModuleRequest) String() string { func (*DeleteModuleRequest) ProtoMessage() {} func (x *DeleteModuleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[7] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -465,7 +474,7 @@ func (x *DeleteModuleRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteModuleRequest.ProtoReflect.Descriptor instead. func (*DeleteModuleRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{7} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{7} } func (x *DeleteModuleRequest) GetName() string { @@ -488,7 +497,7 @@ type DeleteModuleResponse struct { func (x *DeleteModuleResponse) Reset() { *x = DeleteModuleResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[8] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -501,7 +510,7 @@ func (x *DeleteModuleResponse) String() string { func (*DeleteModuleResponse) ProtoMessage() {} func (x *DeleteModuleResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[8] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -514,7 +523,7 @@ func (x *DeleteModuleResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteModuleResponse.ProtoReflect.Descriptor instead. func (*DeleteModuleResponse) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{8} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{8} } func (x *DeleteModuleResponse) GetName() string { @@ -539,7 +548,7 @@ type DeleteModuleTagRequest struct { func (x *DeleteModuleTagRequest) Reset() { *x = DeleteModuleTagRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[9] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -552,7 +561,7 @@ func (x *DeleteModuleTagRequest) String() string { func (*DeleteModuleTagRequest) ProtoMessage() {} func (x *DeleteModuleTagRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[9] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -565,7 +574,7 @@ func (x *DeleteModuleTagRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteModuleTagRequest.ProtoReflect.Descriptor instead. func (*DeleteModuleTagRequest) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{9} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{9} } func (x *DeleteModuleTagRequest) GetName() string { @@ -597,7 +606,7 @@ type DeleteModuleTagResponse struct { func (x *DeleteModuleTagResponse) Reset() { *x = DeleteModuleTagResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[10] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +619,7 @@ func (x *DeleteModuleTagResponse) String() string { func (*DeleteModuleTagResponse) ProtoMessage() {} func (x *DeleteModuleTagResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[10] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +632,7 @@ func (x *DeleteModuleTagResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteModuleTagResponse.ProtoReflect.Descriptor instead. func (*DeleteModuleTagResponse) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{10} + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{10} } func (x *DeleteModuleTagResponse) GetName() string { @@ -640,37 +649,35 @@ func (x *DeleteModuleTagResponse) GetTag() string { return "" } -// Module is a module registered in the registry. -type Module struct { +// GetModuleDependenciesRequest is the request message for GetModuleDependencies. +type GetModuleDependenciesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the unique identifier of the module. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the module. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The tags of the module. - Tags []string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty"` + // The name of the module to retrieve + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The tag of the module to retrieve + Tag string `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"` } -func (x *Module) Reset() { - *x = Module{} +func (x *GetModuleDependenciesRequest) Reset() { + *x = GetModuleDependenciesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[11] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Module) String() string { +func (x *GetModuleDependenciesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Module) ProtoMessage() {} +func (*GetModuleDependenciesRequest) ProtoMessage() {} -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[11] +func (x *GetModuleDependenciesRequest) ProtoReflect() protoreflect.Message { + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -681,61 +688,52 @@ func (x *Module) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{11} +// Deprecated: Use GetModuleDependenciesRequest.ProtoReflect.Descriptor instead. +func (*GetModuleDependenciesRequest) Descriptor() ([]byte, []int) { + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{11} } -func (x *Module) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Module) GetName() string { +func (x *GetModuleDependenciesRequest) GetName() string { if x != nil { return x.Name } return "" } -func (x *Module) GetTags() []string { +func (x *GetModuleDependenciesRequest) GetTag() string { if x != nil { - return x.Tags + return x.Tag } - return nil + return "" } -// ProtoFile is a proto file registered in the registry. -type ProtoFile struct { +// GetModuleDependenciesResponse is the response message for GetModuleDependencies. +type GetModuleDependenciesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The filename of the proto file. - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` - // The content of the proto file. - Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + // The dependencies of the module. + Dependencies []*Dependency `protobuf:"bytes,1,rep,name=dependencies,proto3" json:"dependencies,omitempty"` } -func (x *ProtoFile) Reset() { - *x = ProtoFile{} +func (x *GetModuleDependenciesResponse) Reset() { + *x = GetModuleDependenciesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_v1_registry_proto_msgTypes[12] + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ProtoFile) String() string { +func (x *GetModuleDependenciesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ProtoFile) ProtoMessage() {} +func (*GetModuleDependenciesResponse) ProtoMessage() {} -func (x *ProtoFile) ProtoReflect() protoreflect.Message { - mi := &file_v1_registry_proto_msgTypes[12] +func (x *GetModuleDependenciesResponse) ProtoReflect() protoreflect.Message { + mi := &file_pbuf_registry_v1_registry_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -746,71 +744,71 @@ func (x *ProtoFile) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ProtoFile.ProtoReflect.Descriptor instead. -func (*ProtoFile) Descriptor() ([]byte, []int) { - return file_v1_registry_proto_rawDescGZIP(), []int{12} +// Deprecated: Use GetModuleDependenciesResponse.ProtoReflect.Descriptor instead. +func (*GetModuleDependenciesResponse) Descriptor() ([]byte, []int) { + return file_pbuf_registry_v1_registry_proto_rawDescGZIP(), []int{12} } -func (x *ProtoFile) GetFilename() string { +func (x *GetModuleDependenciesResponse) GetDependencies() []*Dependency { if x != nil { - return x.Filename + return x.Dependencies } - return "" -} - -func (x *ProtoFile) GetContent() string { - if x != nil { - return x.Content - } - return "" + return nil } -var File_v1_registry_proto protoreflect.FileDescriptor - -var file_v1_registry_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x52, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, - 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, - 0x12, 0x28, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x26, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, - 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x81, 0x01, - 0x0a, 0x12, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x06, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x75, 0x66, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x73, 0x22, 0x2b, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x83, - 0x01, 0x0a, 0x11, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, - 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, +var File_pbuf_registry_v1_registry_proto protoreflect.FileDescriptor + +var file_pbuf_registry_v1_registry_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x62, 0x75, 0x66, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, + 0x76, 0x31, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0f, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x70, 0x62, 0x75, 0x66, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, + 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x52, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x72, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, + 0x28, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x26, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x39, 0x0a, 0x11, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x81, 0x01, 0x0a, + 0x12, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x06, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x22, 0x2b, 0x0a, 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xc4, 0x01, + 0x0a, 0x11, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x3a, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, + 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x75, 0x66, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x22, 0x29, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2a, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, @@ -823,132 +821,152 @@ var file_v1_registry_proto_rawDesc = []byte{ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x40, 0x0a, 0x06, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, - 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0x41, - 0x0a, 0x09, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x32, 0xb6, 0x06, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x6d, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x23, 0x2e, + 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x61, 0x67, 0x22, 0x44, 0x0a, 0x1c, + 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, + 0x61, 0x67, 0x22, 0x60, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x62, 0x75, 0x66, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x65, + 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x32, 0xca, 0x07, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x12, 0x6d, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x23, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x0d, 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x63, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x13, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0d, - 0x12, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x63, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x75, - 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, - 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, - 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x12, 0x69, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, - 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, - 0x22, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x12, 0x7c, 0x0a, - 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x70, 0x62, - 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, - 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x23, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, - 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x74, 0x61, 0x67, 0x73, 0x2f, 0x7b, 0x74, 0x61, 0x67, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x50, - 0x75, 0x73, 0x68, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x75, 0x66, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, + 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2f, 0x67, 0x65, 0x74, 0x12, 0x69, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x26, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x17, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, + 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, + 0x12, 0x72, 0x0a, 0x0a, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x22, + 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x6c, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, + 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, + 0x70, 0x75, 0x6c, 0x6c, 0x12, 0x66, 0x0a, 0x0a, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, + 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x12, 0x7a, 0x0a, 0x0c, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x24, 0x2e, 0x70, + 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x17, 0x3a, 0x01, 0x2a, 0x22, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x73, 0x2f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x88, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x12, 0x27, 0x2e, 0x70, + 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x74, 0x61, 0x67, 0x73, 0x2f, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x12, 0x9b, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x2d, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x01, - 0x2a, 0x22, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x70, - 0x75, 0x73, 0x68, 0x12, 0x77, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x75, 0x66, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x8b, 0x01, 0x0a, - 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, - 0x12, 0x27, 0x2e, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, - 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x62, 0x75, 0x66, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x2a, 0x1d, 0x2f, 0x76, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, - 0x74, 0x61, 0x67, 0x73, 0x2f, 0x7b, 0x74, 0x61, 0x67, 0x7d, 0x42, 0x18, 0x5a, 0x16, 0x70, 0x62, - 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, + 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x70, + 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, + 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, + 0x73, 0x42, 0x18, 0x5a, 0x16, 0x70, 0x62, 0x75, 0x66, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, + 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( - file_v1_registry_proto_rawDescOnce sync.Once - file_v1_registry_proto_rawDescData = file_v1_registry_proto_rawDesc + file_pbuf_registry_v1_registry_proto_rawDescOnce sync.Once + file_pbuf_registry_v1_registry_proto_rawDescData = file_pbuf_registry_v1_registry_proto_rawDesc ) -func file_v1_registry_proto_rawDescGZIP() []byte { - file_v1_registry_proto_rawDescOnce.Do(func() { - file_v1_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_registry_proto_rawDescData) +func file_pbuf_registry_v1_registry_proto_rawDescGZIP() []byte { + file_pbuf_registry_v1_registry_proto_rawDescOnce.Do(func() { + file_pbuf_registry_v1_registry_proto_rawDescData = protoimpl.X.CompressGZIP(file_pbuf_registry_v1_registry_proto_rawDescData) }) - return file_v1_registry_proto_rawDescData -} - -var file_v1_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_v1_registry_proto_goTypes = []interface{}{ - (*ListModulesRequest)(nil), // 0: pbufregistry.v1.ListModulesRequest - (*ListModulesResponse)(nil), // 1: pbufregistry.v1.ListModulesResponse - (*GetModuleRequest)(nil), // 2: pbufregistry.v1.GetModuleRequest - (*PullModuleRequest)(nil), // 3: pbufregistry.v1.PullModuleRequest - (*PullModuleResponse)(nil), // 4: pbufregistry.v1.PullModuleResponse - (*RegisterModuleRequest)(nil), // 5: pbufregistry.v1.RegisterModuleRequest - (*PushModuleRequest)(nil), // 6: pbufregistry.v1.PushModuleRequest - (*DeleteModuleRequest)(nil), // 7: pbufregistry.v1.DeleteModuleRequest - (*DeleteModuleResponse)(nil), // 8: pbufregistry.v1.DeleteModuleResponse - (*DeleteModuleTagRequest)(nil), // 9: pbufregistry.v1.DeleteModuleTagRequest - (*DeleteModuleTagResponse)(nil), // 10: pbufregistry.v1.DeleteModuleTagResponse - (*Module)(nil), // 11: pbufregistry.v1.Module - (*ProtoFile)(nil), // 12: pbufregistry.v1.ProtoFile -} -var file_v1_registry_proto_depIdxs = []int32{ - 11, // 0: pbufregistry.v1.ListModulesResponse.modules:type_name -> pbufregistry.v1.Module - 11, // 1: pbufregistry.v1.PullModuleResponse.module:type_name -> pbufregistry.v1.Module - 12, // 2: pbufregistry.v1.PullModuleResponse.protofiles:type_name -> pbufregistry.v1.ProtoFile - 12, // 3: pbufregistry.v1.PushModuleRequest.protofiles:type_name -> pbufregistry.v1.ProtoFile - 0, // 4: pbufregistry.v1.Registry.ListModules:input_type -> pbufregistry.v1.ListModulesRequest - 2, // 5: pbufregistry.v1.Registry.GetModule:input_type -> pbufregistry.v1.GetModuleRequest - 5, // 6: pbufregistry.v1.Registry.RegisterModule:input_type -> pbufregistry.v1.RegisterModuleRequest - 3, // 7: pbufregistry.v1.Registry.PullModule:input_type -> pbufregistry.v1.PullModuleRequest - 6, // 8: pbufregistry.v1.Registry.PushModule:input_type -> pbufregistry.v1.PushModuleRequest - 7, // 9: pbufregistry.v1.Registry.DeleteModule:input_type -> pbufregistry.v1.DeleteModuleRequest - 9, // 10: pbufregistry.v1.Registry.DeleteModuleTag:input_type -> pbufregistry.v1.DeleteModuleTagRequest - 1, // 11: pbufregistry.v1.Registry.ListModules:output_type -> pbufregistry.v1.ListModulesResponse - 11, // 12: pbufregistry.v1.Registry.GetModule:output_type -> pbufregistry.v1.Module - 11, // 13: pbufregistry.v1.Registry.RegisterModule:output_type -> pbufregistry.v1.Module - 4, // 14: pbufregistry.v1.Registry.PullModule:output_type -> pbufregistry.v1.PullModuleResponse - 11, // 15: pbufregistry.v1.Registry.PushModule:output_type -> pbufregistry.v1.Module - 8, // 16: pbufregistry.v1.Registry.DeleteModule:output_type -> pbufregistry.v1.DeleteModuleResponse - 10, // 17: pbufregistry.v1.Registry.DeleteModuleTag:output_type -> pbufregistry.v1.DeleteModuleTagResponse - 11, // [11:18] is the sub-list for method output_type - 4, // [4:11] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_v1_registry_proto_init() } -func file_v1_registry_proto_init() { - if File_v1_registry_proto != nil { + return file_pbuf_registry_v1_registry_proto_rawDescData +} + +var file_pbuf_registry_v1_registry_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_pbuf_registry_v1_registry_proto_goTypes = []interface{}{ + (*ListModulesRequest)(nil), // 0: pbufregistry.v1.ListModulesRequest + (*ListModulesResponse)(nil), // 1: pbufregistry.v1.ListModulesResponse + (*GetModuleRequest)(nil), // 2: pbufregistry.v1.GetModuleRequest + (*PullModuleRequest)(nil), // 3: pbufregistry.v1.PullModuleRequest + (*PullModuleResponse)(nil), // 4: pbufregistry.v1.PullModuleResponse + (*RegisterModuleRequest)(nil), // 5: pbufregistry.v1.RegisterModuleRequest + (*PushModuleRequest)(nil), // 6: pbufregistry.v1.PushModuleRequest + (*DeleteModuleRequest)(nil), // 7: pbufregistry.v1.DeleteModuleRequest + (*DeleteModuleResponse)(nil), // 8: pbufregistry.v1.DeleteModuleResponse + (*DeleteModuleTagRequest)(nil), // 9: pbufregistry.v1.DeleteModuleTagRequest + (*DeleteModuleTagResponse)(nil), // 10: pbufregistry.v1.DeleteModuleTagResponse + (*GetModuleDependenciesRequest)(nil), // 11: pbufregistry.v1.GetModuleDependenciesRequest + (*GetModuleDependenciesResponse)(nil), // 12: pbufregistry.v1.GetModuleDependenciesResponse + (*Module)(nil), // 13: pbufregistry.v1.Module + (*ProtoFile)(nil), // 14: pbufregistry.v1.ProtoFile + (*Dependency)(nil), // 15: pbufregistry.v1.Dependency +} +var file_pbuf_registry_v1_registry_proto_depIdxs = []int32{ + 13, // 0: pbufregistry.v1.ListModulesResponse.modules:type_name -> pbufregistry.v1.Module + 13, // 1: pbufregistry.v1.PullModuleResponse.module:type_name -> pbufregistry.v1.Module + 14, // 2: pbufregistry.v1.PullModuleResponse.protofiles:type_name -> pbufregistry.v1.ProtoFile + 14, // 3: pbufregistry.v1.PushModuleRequest.protofiles:type_name -> pbufregistry.v1.ProtoFile + 15, // 4: pbufregistry.v1.PushModuleRequest.dependencies:type_name -> pbufregistry.v1.Dependency + 15, // 5: pbufregistry.v1.GetModuleDependenciesResponse.dependencies:type_name -> pbufregistry.v1.Dependency + 0, // 6: pbufregistry.v1.Registry.ListModules:input_type -> pbufregistry.v1.ListModulesRequest + 2, // 7: pbufregistry.v1.Registry.GetModule:input_type -> pbufregistry.v1.GetModuleRequest + 5, // 8: pbufregistry.v1.Registry.RegisterModule:input_type -> pbufregistry.v1.RegisterModuleRequest + 3, // 9: pbufregistry.v1.Registry.PullModule:input_type -> pbufregistry.v1.PullModuleRequest + 6, // 10: pbufregistry.v1.Registry.PushModule:input_type -> pbufregistry.v1.PushModuleRequest + 7, // 11: pbufregistry.v1.Registry.DeleteModule:input_type -> pbufregistry.v1.DeleteModuleRequest + 9, // 12: pbufregistry.v1.Registry.DeleteModuleTag:input_type -> pbufregistry.v1.DeleteModuleTagRequest + 11, // 13: pbufregistry.v1.Registry.GetModuleDependencies:input_type -> pbufregistry.v1.GetModuleDependenciesRequest + 1, // 14: pbufregistry.v1.Registry.ListModules:output_type -> pbufregistry.v1.ListModulesResponse + 13, // 15: pbufregistry.v1.Registry.GetModule:output_type -> pbufregistry.v1.Module + 13, // 16: pbufregistry.v1.Registry.RegisterModule:output_type -> pbufregistry.v1.Module + 4, // 17: pbufregistry.v1.Registry.PullModule:output_type -> pbufregistry.v1.PullModuleResponse + 13, // 18: pbufregistry.v1.Registry.PushModule:output_type -> pbufregistry.v1.Module + 8, // 19: pbufregistry.v1.Registry.DeleteModule:output_type -> pbufregistry.v1.DeleteModuleResponse + 10, // 20: pbufregistry.v1.Registry.DeleteModuleTag:output_type -> pbufregistry.v1.DeleteModuleTagResponse + 12, // 21: pbufregistry.v1.Registry.GetModuleDependencies:output_type -> pbufregistry.v1.GetModuleDependenciesResponse + 14, // [14:22] is the sub-list for method output_type + 6, // [6:14] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_pbuf_registry_v1_registry_proto_init() } +func file_pbuf_registry_v1_registry_proto_init() { + if File_pbuf_registry_v1_registry_proto != nil { return } + file_pbuf_registry_v1_entities_proto_init() if !protoimpl.UnsafeEnabled { - file_v1_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListModulesRequest); i { case 0: return &v.state @@ -960,7 +978,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListModulesResponse); i { case 0: return &v.state @@ -972,7 +990,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetModuleRequest); i { case 0: return &v.state @@ -984,7 +1002,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PullModuleRequest); i { case 0: return &v.state @@ -996,7 +1014,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PullModuleResponse); i { case 0: return &v.state @@ -1008,7 +1026,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RegisterModuleRequest); i { case 0: return &v.state @@ -1020,7 +1038,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PushModuleRequest); i { case 0: return &v.state @@ -1032,7 +1050,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteModuleRequest); i { case 0: return &v.state @@ -1044,7 +1062,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteModuleResponse); i { case 0: return &v.state @@ -1056,7 +1074,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteModuleTagRequest); i { case 0: return &v.state @@ -1068,7 +1086,7 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_pbuf_registry_v1_registry_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteModuleTagResponse); i { case 0: return &v.state @@ -1080,8 +1098,8 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { + file_pbuf_registry_v1_registry_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetModuleDependenciesRequest); i { case 0: return &v.state case 1: @@ -1092,8 +1110,8 @@ func file_v1_registry_proto_init() { return nil } } - file_v1_registry_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtoFile); i { + file_pbuf_registry_v1_registry_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetModuleDependenciesResponse); i { case 0: return &v.state case 1: @@ -1109,18 +1127,18 @@ func file_v1_registry_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v1_registry_proto_rawDesc, + RawDescriptor: file_pbuf_registry_v1_registry_proto_rawDesc, NumEnums: 0, NumMessages: 13, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_v1_registry_proto_goTypes, - DependencyIndexes: file_v1_registry_proto_depIdxs, - MessageInfos: file_v1_registry_proto_msgTypes, + GoTypes: file_pbuf_registry_v1_registry_proto_goTypes, + DependencyIndexes: file_pbuf_registry_v1_registry_proto_depIdxs, + MessageInfos: file_pbuf_registry_v1_registry_proto_msgTypes, }.Build() - File_v1_registry_proto = out.File - file_v1_registry_proto_rawDesc = nil - file_v1_registry_proto_goTypes = nil - file_v1_registry_proto_depIdxs = nil + File_pbuf_registry_v1_registry_proto = out.File + file_pbuf_registry_v1_registry_proto_rawDesc = nil + file_pbuf_registry_v1_registry_proto_goTypes = nil + file_pbuf_registry_v1_registry_proto_depIdxs = nil } diff --git a/gen/v1/registry.pb.gw.go b/gen/pbuf-registry/v1/registry.pb.gw.go similarity index 76% rename from gen/v1/registry.pb.gw.go rename to gen/pbuf-registry/v1/registry.pb.gw.go index af014b2..07cd2e5 100644 --- a/gen/v1/registry.pb.gw.go +++ b/gen/pbuf-registry/v1/registry.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: v1/registry.proto +// source: pbuf-registry/v1/registry.proto /* Package v1 is a reverse proxy. @@ -71,21 +71,12 @@ func request_Registry_GetModule_0(ctx context.Context, marshaler runtime.Marshal var protoReq GetModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.GetModule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -97,21 +88,12 @@ func local_request_Registry_GetModule_0(ctx context.Context, marshaler runtime.M var protoReq GetModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.GetModule(ctx, &protoReq) @@ -157,31 +139,12 @@ func request_Registry_PullModule_0(ctx context.Context, marshaler runtime.Marsha var protoReq PullModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - val, ok = pathParams["tag"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Tag, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.PullModule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -193,31 +156,12 @@ func local_request_Registry_PullModule_0(ctx context.Context, marshaler runtime. var protoReq PullModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - val, ok = pathParams["tag"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Tag, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.PullModule(ctx, &protoReq) @@ -263,21 +207,12 @@ func request_Registry_DeleteModule_0(ctx context.Context, marshaler runtime.Mars var protoReq DeleteModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.DeleteModule(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -289,21 +224,12 @@ func local_request_Registry_DeleteModule_0(ctx context.Context, marshaler runtim var protoReq DeleteModuleRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.DeleteModule(ctx, &protoReq) @@ -315,31 +241,12 @@ func request_Registry_DeleteModuleTag_0(ctx context.Context, marshaler runtime.M var protoReq DeleteModuleTagRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") - } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) - } - - val, ok = pathParams["tag"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Tag, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.DeleteModuleTag(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -351,34 +258,49 @@ func local_request_Registry_DeleteModuleTag_0(ctx context.Context, marshaler run var protoReq DeleteModuleTagRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["name"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) } - - protoReq.Name, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - val, ok = pathParams["tag"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "tag") + msg, err := server.DeleteModuleTag(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Registry_GetModuleDependencies_0(ctx context.Context, marshaler runtime.Marshaler, client RegistryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetModuleDependenciesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - protoReq.Tag, err = runtime.String(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "tag", err) + msg, err := client.GetModuleDependencies(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Registry_GetModuleDependencies_0(ctx context.Context, marshaler runtime.Marshaler, server RegistryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetModuleDependenciesRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.DeleteModuleTag(ctx, &protoReq) + msg, err := server.GetModuleDependencies(ctx, &protoReq) return msg, metadata, err } @@ -414,7 +336,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) - mux.Handle("GET", pattern_Registry_GetModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_GetModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -422,7 +344,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModule", runtime.WithHTTPPathPattern("/v1/modules/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModule", runtime.WithHTTPPathPattern("/v1/modules/get")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -464,7 +386,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) - mux.Handle("GET", pattern_Registry_PullModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_PullModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -472,7 +394,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/PullModule", runtime.WithHTTPPathPattern("/v1/modules/{name}/tags/{tag}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/PullModule", runtime.WithHTTPPathPattern("/v1/modules/pull")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -514,7 +436,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) - mux.Handle("DELETE", pattern_Registry_DeleteModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_DeleteModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -522,7 +444,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModule", runtime.WithHTTPPathPattern("/v1/modules/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModule", runtime.WithHTTPPathPattern("/v1/modules/delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -539,7 +461,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) - mux.Handle("DELETE", pattern_Registry_DeleteModuleTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_DeleteModuleTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -547,7 +469,7 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModuleTag", runtime.WithHTTPPathPattern("/v1/modules/{name}/tags/{tag}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModuleTag", runtime.WithHTTPPathPattern("/v1/modules/tags/delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -564,6 +486,31 @@ func RegisterRegistryHandlerServer(ctx context.Context, mux *runtime.ServeMux, s }) + mux.Handle("POST", pattern_Registry_GetModuleDependencies_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModuleDependencies", runtime.WithHTTPPathPattern("/v1/modules/dependencies")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Registry_GetModuleDependencies_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Registry_GetModuleDependencies_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -627,13 +574,13 @@ func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) - mux.Handle("GET", pattern_Registry_GetModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_GetModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModule", runtime.WithHTTPPathPattern("/v1/modules/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModule", runtime.WithHTTPPathPattern("/v1/modules/get")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -671,13 +618,13 @@ func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) - mux.Handle("GET", pattern_Registry_PullModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_PullModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/PullModule", runtime.WithHTTPPathPattern("/v1/modules/{name}/tags/{tag}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/PullModule", runtime.WithHTTPPathPattern("/v1/modules/pull")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -715,13 +662,13 @@ func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) - mux.Handle("DELETE", pattern_Registry_DeleteModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_DeleteModule_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModule", runtime.WithHTTPPathPattern("/v1/modules/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModule", runtime.WithHTTPPathPattern("/v1/modules/delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -737,13 +684,13 @@ func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) - mux.Handle("DELETE", pattern_Registry_DeleteModuleTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("POST", pattern_Registry_DeleteModuleTag_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModuleTag", runtime.WithHTTPPathPattern("/v1/modules/{name}/tags/{tag}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/DeleteModuleTag", runtime.WithHTTPPathPattern("/v1/modules/tags/delete")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -759,23 +706,47 @@ func RegisterRegistryHandlerClient(ctx context.Context, mux *runtime.ServeMux, c }) + mux.Handle("POST", pattern_Registry_GetModuleDependencies_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pbufregistry.v1.Registry/GetModuleDependencies", runtime.WithHTTPPathPattern("/v1/modules/dependencies")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Registry_GetModuleDependencies_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Registry_GetModuleDependencies_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_Registry_ListModules_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "modules"}, "")) - pattern_Registry_GetModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "modules", "name"}, "")) + pattern_Registry_GetModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "modules", "get"}, "")) pattern_Registry_RegisterModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "modules"}, "")) - pattern_Registry_PullModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "modules", "name", "tags", "tag"}, "")) + pattern_Registry_PullModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "modules", "pull"}, "")) pattern_Registry_PushModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "modules", "push"}, "")) - pattern_Registry_DeleteModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "modules", "name"}, "")) + pattern_Registry_DeleteModule_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "modules", "delete"}, "")) - pattern_Registry_DeleteModuleTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "modules", "name", "tags", "tag"}, "")) + pattern_Registry_DeleteModuleTag_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "modules", "tags", "delete"}, "")) + + pattern_Registry_GetModuleDependencies_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "modules", "dependencies"}, "")) ) var ( @@ -792,4 +763,6 @@ var ( forward_Registry_DeleteModule_0 = runtime.ForwardResponseMessage forward_Registry_DeleteModuleTag_0 = runtime.ForwardResponseMessage + + forward_Registry_GetModuleDependencies_0 = runtime.ForwardResponseMessage ) diff --git a/gen/v1/registry.swagger.json b/gen/pbuf-registry/v1/registry.swagger.json similarity index 67% rename from gen/v1/registry.swagger.json rename to gen/pbuf-registry/v1/registry.swagger.json index 6d82c58..8392d59 100644 --- a/gen/v1/registry.swagger.json +++ b/gen/pbuf-registry/v1/registry.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "v1/registry.proto", + "title": "pbuf-registry/v1/registry.proto", "version": "version not set" }, "tags": [ @@ -88,15 +88,15 @@ ] } }, - "/v1/modules/push": { + "/v1/modules/delete": { "post": { - "summary": "Push a module", - "operationId": "Registry_PushModule", + "summary": "Delete a module by name", + "operationId": "Registry_DeleteModule", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1Module" + "$ref": "#/definitions/v1DeleteModuleResponse" } }, "default": { @@ -109,11 +109,11 @@ "parameters": [ { "name": "body", - "description": "PushModuleRequest is the request message for PushModule.", + "description": "DeleteModuleRequest is the request message for DeleteModule.", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/v1PushModuleRequest" + "$ref": "#/definitions/v1DeleteModuleRequest" } } ], @@ -122,15 +122,15 @@ ] } }, - "/v1/modules/{name}": { - "get": { - "summary": "Get a module by name", - "operationId": "Registry_GetModule", + "/v1/modules/dependencies": { + "post": { + "summary": "Get Module Dependencies", + "operationId": "Registry_GetModuleDependencies", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1Module" + "$ref": "#/definitions/v1GetModuleDependenciesResponse" } }, "default": { @@ -142,25 +142,29 @@ }, "parameters": [ { - "name": "name", - "description": "The name of the module to retrieve.", - "in": "path", + "name": "body", + "description": "GetModuleDependenciesRequest is the request message for GetModuleDependencies.", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/v1GetModuleDependenciesRequest" + } } ], "tags": [ "Registry" ] - }, - "delete": { - "summary": "Delete a module by name", - "operationId": "Registry_DeleteModule", + } + }, + "/v1/modules/get": { + "post": { + "summary": "Get a module by name", + "operationId": "Registry_GetModule", "responses": { "200": { "description": "A successful response.", "schema": { - "$ref": "#/definitions/v1DeleteModuleResponse" + "$ref": "#/definitions/v1Module" } }, "default": { @@ -172,11 +176,13 @@ }, "parameters": [ { - "name": "name", - "description": "The name of the module to delete.", - "in": "path", + "name": "body", + "description": "GetModuleRequest is the request message for GetModule.", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/v1GetModuleRequest" + } } ], "tags": [ @@ -184,8 +190,8 @@ ] } }, - "/v1/modules/{name}/tags/{tag}": { - "get": { + "/v1/modules/pull": { + "post": { "summary": "Pull a module tag", "operationId": "Registry_PullModule", "responses": { @@ -204,25 +210,56 @@ }, "parameters": [ { - "name": "name", - "description": "The name of the module to retrieve.", - "in": "path", + "name": "body", + "description": "PullModuleRequest is the request message for PullModule.", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/v1PullModuleRequest" + } + } + ], + "tags": [ + "Registry" + ] + } + }, + "/v1/modules/push": { + "post": { + "summary": "Push a module", + "operationId": "Registry_PushModule", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1Module" + } }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ { - "name": "tag", - "description": "The tag of the module to retrieve.", - "in": "path", + "name": "body", + "description": "PushModuleRequest is the request message for PushModule.", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/v1PushModuleRequest" + } } ], "tags": [ "Registry" ] - }, - "delete": { + } + }, + "/v1/modules/tags/delete": { + "post": { "summary": "Delete a specific module tag", "operationId": "Registry_DeleteModuleTag", "responses": { @@ -241,18 +278,13 @@ }, "parameters": [ { - "name": "name", - "description": "The name of the module to delete.", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "tag", - "description": "The tag of the module to delete.", - "in": "path", + "name": "body", + "description": "DeleteModuleTagRequest is the request message for DeleteModuleTag.", + "in": "body", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/v1DeleteModuleTagRequest" + } } ], "tags": [ @@ -290,6 +322,16 @@ } } }, + "v1DeleteModuleRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the module to delete." + } + }, + "description": "DeleteModuleRequest is the request message for DeleteModule." + }, "v1DeleteModuleResponse": { "type": "object", "properties": { @@ -300,6 +342,20 @@ }, "description": "DeleteModuleResponse is the response message for DeleteModule." }, + "v1DeleteModuleTagRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the module to delete." + }, + "tag": { + "type": "string", + "description": "The tag of the module to delete." + } + }, + "description": "DeleteModuleTagRequest is the request message for DeleteModuleTag." + }, "v1DeleteModuleTagResponse": { "type": "object", "properties": { @@ -314,6 +370,58 @@ }, "description": "DeleteModuleTagResponse is the response message for DeleteModuleTag." }, + "v1Dependency": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the dependency." + }, + "tag": { + "type": "string", + "description": "The tag of the dependency." + } + }, + "description": "Dependency is a dependency registered in the registry." + }, + "v1GetModuleDependenciesRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "The name of the module to retrieve" + }, + "tag": { + "type": "string", + "title": "The tag of the module to retrieve" + } + }, + "description": "GetModuleDependenciesRequest is the request message for GetModuleDependencies." + }, + "v1GetModuleDependenciesResponse": { + "type": "object", + "properties": { + "dependencies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Dependency" + }, + "description": "The dependencies of the module." + } + }, + "description": "GetModuleDependenciesResponse is the response message for GetModuleDependencies." + }, + "v1GetModuleRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the module to retrieve." + } + }, + "description": "GetModuleRequest is the request message for GetModule." + }, "v1ListModulesResponse": { "type": "object", "properties": { @@ -367,6 +475,20 @@ }, "description": "ProtoFile is a proto file registered in the registry." }, + "v1PullModuleRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the module to retrieve." + }, + "tag": { + "type": "string", + "description": "The tag of the module to retrieve." + } + }, + "description": "PullModuleRequest is the request message for PullModule." + }, "v1PullModuleResponse": { "type": "object", "properties": { @@ -403,6 +525,14 @@ "$ref": "#/definitions/v1ProtoFile" }, "title": "Protofiles" + }, + "dependencies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Dependency" + }, + "title": "Dependencies" } }, "description": "PushModuleRequest is the request message for PushModule." diff --git a/gen/v1/registry_grpc.pb.go b/gen/pbuf-registry/v1/registry_grpc.pb.go similarity index 83% rename from gen/v1/registry_grpc.pb.go rename to gen/pbuf-registry/v1/registry_grpc.pb.go index 9dbd394..a2b40ed 100644 --- a/gen/v1/registry_grpc.pb.go +++ b/gen/pbuf-registry/v1/registry_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc (unknown) -// source: v1/registry.proto +// source: pbuf-registry/v1/registry.proto package v1 @@ -19,13 +19,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Registry_ListModules_FullMethodName = "/pbufregistry.v1.Registry/ListModules" - Registry_GetModule_FullMethodName = "/pbufregistry.v1.Registry/GetModule" - Registry_RegisterModule_FullMethodName = "/pbufregistry.v1.Registry/RegisterModule" - Registry_PullModule_FullMethodName = "/pbufregistry.v1.Registry/PullModule" - Registry_PushModule_FullMethodName = "/pbufregistry.v1.Registry/PushModule" - Registry_DeleteModule_FullMethodName = "/pbufregistry.v1.Registry/DeleteModule" - Registry_DeleteModuleTag_FullMethodName = "/pbufregistry.v1.Registry/DeleteModuleTag" + Registry_ListModules_FullMethodName = "/pbufregistry.v1.Registry/ListModules" + Registry_GetModule_FullMethodName = "/pbufregistry.v1.Registry/GetModule" + Registry_RegisterModule_FullMethodName = "/pbufregistry.v1.Registry/RegisterModule" + Registry_PullModule_FullMethodName = "/pbufregistry.v1.Registry/PullModule" + Registry_PushModule_FullMethodName = "/pbufregistry.v1.Registry/PushModule" + Registry_DeleteModule_FullMethodName = "/pbufregistry.v1.Registry/DeleteModule" + Registry_DeleteModuleTag_FullMethodName = "/pbufregistry.v1.Registry/DeleteModuleTag" + Registry_GetModuleDependencies_FullMethodName = "/pbufregistry.v1.Registry/GetModuleDependencies" ) // RegistryClient is the client API for Registry service. @@ -46,6 +47,8 @@ type RegistryClient interface { DeleteModule(ctx context.Context, in *DeleteModuleRequest, opts ...grpc.CallOption) (*DeleteModuleResponse, error) // Delete a specific module tag DeleteModuleTag(ctx context.Context, in *DeleteModuleTagRequest, opts ...grpc.CallOption) (*DeleteModuleTagResponse, error) + // Get Module Dependencies + GetModuleDependencies(ctx context.Context, in *GetModuleDependenciesRequest, opts ...grpc.CallOption) (*GetModuleDependenciesResponse, error) } type registryClient struct { @@ -119,6 +122,15 @@ func (c *registryClient) DeleteModuleTag(ctx context.Context, in *DeleteModuleTa return out, nil } +func (c *registryClient) GetModuleDependencies(ctx context.Context, in *GetModuleDependenciesRequest, opts ...grpc.CallOption) (*GetModuleDependenciesResponse, error) { + out := new(GetModuleDependenciesResponse) + err := c.cc.Invoke(ctx, Registry_GetModuleDependencies_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // RegistryServer is the server API for Registry service. // All implementations must embed UnimplementedRegistryServer // for forward compatibility @@ -137,6 +149,8 @@ type RegistryServer interface { DeleteModule(context.Context, *DeleteModuleRequest) (*DeleteModuleResponse, error) // Delete a specific module tag DeleteModuleTag(context.Context, *DeleteModuleTagRequest) (*DeleteModuleTagResponse, error) + // Get Module Dependencies + GetModuleDependencies(context.Context, *GetModuleDependenciesRequest) (*GetModuleDependenciesResponse, error) mustEmbedUnimplementedRegistryServer() } @@ -165,6 +179,9 @@ func (UnimplementedRegistryServer) DeleteModule(context.Context, *DeleteModuleRe func (UnimplementedRegistryServer) DeleteModuleTag(context.Context, *DeleteModuleTagRequest) (*DeleteModuleTagResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteModuleTag not implemented") } +func (UnimplementedRegistryServer) GetModuleDependencies(context.Context, *GetModuleDependenciesRequest) (*GetModuleDependenciesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetModuleDependencies not implemented") +} func (UnimplementedRegistryServer) mustEmbedUnimplementedRegistryServer() {} // UnsafeRegistryServer may be embedded to opt out of forward compatibility for this service. @@ -304,6 +321,24 @@ func _Registry_DeleteModuleTag_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Registry_GetModuleDependencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetModuleDependenciesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetModuleDependencies(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Registry_GetModuleDependencies_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetModuleDependencies(ctx, req.(*GetModuleDependenciesRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Registry_ServiceDesc is the grpc.ServiceDesc for Registry service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -339,7 +374,11 @@ var Registry_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteModuleTag", Handler: _Registry_DeleteModuleTag_Handler, }, + { + MethodName: "GetModuleDependencies", + Handler: _Registry_GetModuleDependencies_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "v1/registry.proto", + Metadata: "pbuf-registry/v1/registry.proto", } diff --git a/internal/data/registry.go b/internal/data/registry.go index 054020c..46567af 100644 --- a/internal/data/registry.go +++ b/internal/data/registry.go @@ -9,7 +9,7 @@ import ( "github.com/google/martian/log" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" ) type RegistryRepository interface { @@ -20,6 +20,8 @@ type RegistryRepository interface { PushModule(ctx context.Context, name string, tag string, protofiles []*v1.ProtoFile) (*v1.Module, error) PullModule(ctx context.Context, name string, tag string) (*v1.Module, []*v1.ProtoFile, error) DeleteModuleTag(ctx context.Context, name string, tag string) error + AddModuleDependencies(ctx context.Context, name string, tag string, dependencies []*v1.Dependency) error + GetModuleDependencies(ctx context.Context, name string, tag string) ([]*v1.Dependency, error) } type registryRepository struct { @@ -59,7 +61,7 @@ func (r *registryRepository) GetModule(ctx context.Context, name string) (*v1.Mo // fetch tags tags, err := r.pool.Query(ctx, - "SELECT tag FROM tags WHERE module_id = $1", + "SELECT tag FROM tags WHERE module_id = $1 ORDER BY updated_at DESC", module.Id) if err != nil { // tags not found @@ -128,15 +130,31 @@ func (r *registryRepository) ListModules(ctx context.Context, pageSize int, toke func (r *registryRepository) DeleteModule(ctx context.Context, name string) error { // delete all protofiles - _, err := r.pool.Exec(ctx, + res, err := r.pool.Exec(ctx, "DELETE FROM protofiles WHERE tag_id IN (SELECT id FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1))", name) if err != nil { return fmt.Errorf("could not delete protofiles from database: %w", err) } + if res.RowsAffected() > 0 { + log.Infof("deleted %d protofiles for module %s", res.RowsAffected(), name) + } + + // delete all module dependencies + res, err = r.pool.Exec(ctx, + "DELETE FROM dependencies WHERE tag_id IN (SELECT id FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1))", + name) + if err != nil { + return fmt.Errorf("could not delete module dependencies from database: %w", err) + } + + if res.RowsAffected() > 0 { + log.Infof("deleted %d dependencies for module %s", res.RowsAffected(), name) + } + // delete all module tags - res, err := r.pool.Exec(ctx, + res, err = r.pool.Exec(ctx, "DELETE FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1)", name) if err != nil { @@ -288,6 +306,18 @@ func (r *registryRepository) DeleteModuleTag(ctx context.Context, name string, t log.Infof("deleted %d protofiles for tag %s", res.RowsAffected(), tag) } + // delete dependencies + res, err = r.pool.Exec(ctx, + "DELETE FROM dependencies WHERE tag_id = $1 OR dependency_tag_id = $1", + tagId) + if err != nil { + return fmt.Errorf("could not delete dependencies from database: %w", err) + } + + if res.RowsAffected() > 0 { + log.Infof("deleted %d dependencies for tag %s", res.RowsAffected(), tag) + } + // delete tag res, err = r.pool.Exec(ctx, "DELETE FROM tags WHERE id = $1", @@ -304,3 +334,94 @@ func (r *registryRepository) DeleteModuleTag(ctx context.Context, name string, t return nil } + +func (r *registryRepository) AddModuleDependencies(ctx context.Context, name string, tag string, dependencies []*v1.Dependency) error { + // find the tag id by name and tag + var tagId string + err := r.pool.QueryRow(ctx, + "SELECT id FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1) AND tag = $2", + name, tag).Scan(&tagId) + if err != nil { + return fmt.Errorf("could not find tag %s for module %s: %w", tag, name, err) + } + + // for each dependency find tag id and insert into dependencies table + for _, dependency := range dependencies { + var dependencyTagId string + err := r.pool.QueryRow(ctx, + "SELECT id FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1) AND tag = $2", + dependency.Name, dependency.Tag).Scan(&dependencyTagId) + if err != nil { + return fmt.Errorf("could not find tag %s for module %s: %w", dependency.Tag, dependency.Name, err) + } + + _, err = r.pool.Exec(ctx, + "INSERT INTO dependencies (tag_id, dependency_tag_id) VALUES ($1, $2)", + tagId, dependencyTagId) + if err != nil { + return fmt.Errorf("could not insert dependency into database: %w", err) + } + } + + return nil +} + +func (r *registryRepository) GetModuleDependencies(ctx context.Context, name string, tag string) ([]*v1.Dependency, error) { + // find the latest tag if tag is empty + if tag == "" { + err := r.pool.QueryRow(ctx, + "SELECT tag FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1) ORDER BY updated_at DESC LIMIT 1", + name).Scan(&tag) + if err != nil { + return nil, fmt.Errorf("could not find tag for module %s: %w", name, err) + } + } + + // find the tag id by name and tag + var tagId string + err := r.pool.QueryRow(ctx, + "SELECT id FROM tags WHERE module_id = (SELECT id FROM modules WHERE name = $1) AND tag = $2", + name, tag).Scan(&tagId) + if err != nil { + return nil, fmt.Errorf("could not find tag %s for module %s: %w", tag, name, err) + } + + // find all dependencies + rows, err := r.pool.Query(ctx, + "SELECT dependency_tag_id FROM dependencies WHERE tag_id = $1", + tagId) + if err != nil { + // if no dependencies found, return empty slice + if errors.Is(err, pgx.ErrNoRows) { + return []*v1.Dependency{}, nil + } + return nil, fmt.Errorf("could not select dependencies from database: %w", err) + } + + var dependencies []*v1.Dependency + + for rows.Next() { + var dependencyTagId string + err := rows.Scan(&dependencyTagId) + if err != nil { + return nil, fmt.Errorf("could not scan dependency: %w", err) + } + + // find the module name and tag by dependency tag id + var dependencyName string + var dependencyTag string + err = r.pool.QueryRow(ctx, + "SELECT modules.name, tags.tag FROM modules JOIN tags ON modules.id = tags.module_id WHERE tags.id = $1", + dependencyTagId).Scan(&dependencyName, &dependencyTag) + if err != nil { + return nil, fmt.Errorf("could not find module and tag for dependency: %w", err) + } + + dependencies = append(dependencies, &v1.Dependency{ + Name: dependencyName, + Tag: dependencyTag, + }) + } + + return dependencies, nil +} diff --git a/internal/data/registry_test.go b/internal/data/registry_test.go index d3269b7..7d10233 100644 --- a/internal/data/registry_test.go +++ b/internal/data/registry_test.go @@ -5,7 +5,7 @@ import ( "reflect" "testing" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" ) const ( @@ -232,6 +232,21 @@ func Test_registryRepository_PushModule(t *testing.T) { want: nil, wantErr: true, }, + { + name: "Push module", + args: args{ + ctx: context.Background(), + name: "pbuf.io/pbuf-registry-2", + tag: "v0.0.0", + protofiles: protofiles, + }, + want: &v1.Module{ + Id: fakeUUID, + Name: "pbuf.io/pbuf-registry-2", + Tags: []string{"v0.0.0"}, + }, + wantErr: false, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -286,7 +301,7 @@ func Test_registryRepository_PullModule(t *testing.T) { name: "Pull module not found", args: args{ ctx: context.Background(), - name: "pbuf.io/pbuf-registry-2", + name: "pbuf.io/pbuf-registry-not-found", tag: "v0.0.0", }, wantModule: nil, @@ -329,6 +344,110 @@ func Test_registryRepository_PullModule(t *testing.T) { } } +func Test_registryRepository_AddModuleDependencies(t *testing.T) { + type args struct { + ctx context.Context + name string + tag string + dependencies []*v1.Dependency + } + type want struct { + dependencies []*v1.Dependency + } + tests := []struct { + name string + args args + want want + wantErr bool + }{ + { + name: "Add module dependencies", + args: args{ + ctx: context.Background(), + name: "pbuf.io/pbuf-registry", + tag: "v0.0.0", + dependencies: []*v1.Dependency{ + { + Name: "pbuf.io/pbuf-registry-2", + Tag: "v0.0.0", + }, + }, + }, + want: want{ + dependencies: []*v1.Dependency{ + { + Name: "pbuf.io/pbuf-registry-2", + Tag: "v0.0.0", + }, + }, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + r := suite.registryRepository + + if err := r.AddModuleDependencies(tt.args.ctx, tt.args.name, tt.args.tag, tt.args.dependencies); (err != nil) != tt.wantErr { + t.Errorf("AddModuleDependencies() error = %v, wantErr %v", err, tt.wantErr) + } + + dependencies, err := r.GetModuleDependencies(tt.args.ctx, tt.args.name, tt.args.tag) + if err != nil { + t.Errorf("GetModuleDependencies() error = %v", err) + } + + if !reflect.DeepEqual(dependencies, tt.want.dependencies) { + t.Errorf("GetModuleDependencies() got = %v, want %v", dependencies, tt.args.dependencies) + } + }) + } +} + +func Test_registryRepository_GetModuleDependencies(t *testing.T) { + type args struct { + ctx context.Context + name string + tag string + } + tests := []struct { + name string + args args + want []*v1.Dependency + wantErr bool + }{ + { + name: "Get module dependencies", + args: args{ + ctx: context.Background(), + name: "pbuf.io/pbuf-registry", + }, + want: []*v1.Dependency{ + { + Name: "pbuf.io/pbuf-registry-2", + Tag: "v0.0.0", + }, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + r := suite.registryRepository + + got, err := r.GetModuleDependencies(tt.args.ctx, tt.args.name, tt.args.tag) + if (err != nil) != tt.wantErr { + t.Errorf("GetModuleDependencies() error = %v, wantErr %v", err, tt.wantErr) + return + } + + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetModuleDependencies() got = %v, want %v", got, tt.want) + } + }) + } +} + func Test_registryRepository_DeleteModuleTag(t *testing.T) { type args struct { ctx context.Context diff --git a/internal/mocks/registry_repository.go b/internal/mocks/registry_repository.go index 4acf037..5e5ab8c 100644 --- a/internal/mocks/registry_repository.go +++ b/internal/mocks/registry_repository.go @@ -7,7 +7,7 @@ import ( mock "github.com/stretchr/testify/mock" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" ) // RegistryRepository is an autogenerated mock type for the RegistryRepository type @@ -15,6 +15,20 @@ type RegistryRepository struct { mock.Mock } +// AddModuleDependencies provides a mock function with given fields: ctx, name, tag, dependencies +func (_m *RegistryRepository) AddModuleDependencies(ctx context.Context, name string, tag string, dependencies []*v1.Dependency) error { + ret := _m.Called(ctx, name, tag, dependencies) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, []*v1.Dependency) error); ok { + r0 = rf(ctx, name, tag, dependencies) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // DeleteModule provides a mock function with given fields: ctx, name func (_m *RegistryRepository) DeleteModule(ctx context.Context, name string) error { ret := _m.Called(ctx, name) @@ -69,6 +83,32 @@ func (_m *RegistryRepository) GetModule(ctx context.Context, name string) (*v1.M return r0, r1 } +// GetModuleDependencies provides a mock function with given fields: ctx, name, tag +func (_m *RegistryRepository) GetModuleDependencies(ctx context.Context, name string, tag string) ([]*v1.Dependency, error) { + ret := _m.Called(ctx, name, tag) + + var r0 []*v1.Dependency + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string) ([]*v1.Dependency, error)); ok { + return rf(ctx, name, tag) + } + if rf, ok := ret.Get(0).(func(context.Context, string, string) []*v1.Dependency); ok { + r0 = rf(ctx, name, tag) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*v1.Dependency) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = rf(ctx, name, tag) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // ListModules provides a mock function with given fields: ctx, pageSize, token func (_m *RegistryRepository) ListModules(ctx context.Context, pageSize int, token string) ([]*v1.Module, string, error) { ret := _m.Called(ctx, pageSize, token) diff --git a/internal/server/registry.go b/internal/server/registry.go index a68e371..ede6b99 100644 --- a/internal/server/registry.go +++ b/internal/server/registry.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/google/martian/log" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" "github.com/pbufio/pbuf-registry/internal/data" "github.com/pbufio/pbuf-registry/internal/utils" ) @@ -110,10 +110,6 @@ func (r *RegistryServer) PushModule(ctx context.Context, request *v1.PushModuleR return nil, errors.New("tag cannot be empty") } - if len(request.Protofiles) == 0 { - return nil, errors.New("protofiles cannot be empty") - } - err := utils.ValidateProtoFiles(request.Protofiles) if err != nil { return nil, err @@ -125,6 +121,12 @@ func (r *RegistryServer) PushModule(ctx context.Context, request *v1.PushModuleR return nil, err } + err = r.registryRepository.AddModuleDependencies(ctx, name, tag, request.Dependencies) + if err != nil { + log.Infof("error while adding dependencies for module: %v", err) + return nil, err + } + return module, nil } @@ -173,3 +175,20 @@ func (r *RegistryServer) DeleteModuleTag(ctx context.Context, request *v1.Delete Tag: tag, }, nil } + +func (r *RegistryServer) GetModuleDependencies(ctx context.Context, request *v1.GetModuleDependenciesRequest) (*v1.GetModuleDependenciesResponse, error) { + name := request.Name + if name == "" { + return nil, errors.New("name cannot be empty") + } + + dependencies, err := r.registryRepository.GetModuleDependencies(ctx, name, request.Tag) + if err != nil { + log.Infof("error getting module dependencies: %v", err) + return nil, err + } + + return &v1.GetModuleDependenciesResponse{ + Dependencies: dependencies, + }, nil +} diff --git a/internal/server/registry_test.go b/internal/server/registry_test.go index 68d43cb..cf2ffb9 100644 --- a/internal/server/registry_test.go +++ b/internal/server/registry_test.go @@ -6,7 +6,7 @@ import ( "net" "testing" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" "github.com/pbufio/pbuf-registry/internal/mocks" "github.com/stretchr/testify/mock" "google.golang.org/grpc" diff --git a/internal/utils/checkers.go b/internal/utils/checkers.go index 76b716d..db0d2c9 100644 --- a/internal/utils/checkers.go +++ b/internal/utils/checkers.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/google/martian/log" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" "github.com/yoheimuta/go-protoparser/v4" ) diff --git a/internal/utils/checkers_test.go b/internal/utils/checkers_test.go index aa66765..2414add 100644 --- a/internal/utils/checkers_test.go +++ b/internal/utils/checkers_test.go @@ -3,7 +3,7 @@ package utils import ( "testing" - v1 "github.com/pbufio/pbuf-registry/gen/v1" + v1 "github.com/pbufio/pbuf-registry/gen/pbuf-registry/v1" ) func TestValidateProtoFiles(t *testing.T) { diff --git a/migrations/20231105143113_modules.sql b/migrations/20231105143113_modules.sql index 15c21e6..69f615a 100644 --- a/migrations/20231105143113_modules.sql +++ b/migrations/20231105143113_modules.sql @@ -8,7 +8,8 @@ CREATE TABLE IF NOT EXISTS modules ( CREATE TABLE IF NOT EXISTS tags ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), module_id UUID NOT NULL, - tag VARCHAR(255) NOT NULL + tag VARCHAR(255) NOT NULL, + UNIQUE (module_id, tag) ); CREATE TABLE IF NOT EXISTS protofiles ( @@ -26,6 +27,10 @@ CREATE INDEX IF NOT EXISTS idx_protofiles_tag_id ON protofiles (tag_id); -- +goose Down -- +goose StatementBegin +DROP INDEX IF EXISTS idx_protofiles_tag_id; +DROP INDEX IF EXISTS idx_tags_module_id_tag; +DROP INDEX IF EXISTS idx_modules_name; + DROP TABLE IF EXISTS protofiles; DROP TABLE IF EXISTS tags; DROP TABLE IF EXISTS modules; diff --git a/migrations/20231113161248_add_timestamp.sql b/migrations/20231113161248_add_timestamp.sql new file mode 100644 index 0000000..56762a7 --- /dev/null +++ b/migrations/20231113161248_add_timestamp.sql @@ -0,0 +1,23 @@ +-- +goose Up +-- +goose StatementBegin +ALTER TABLE modules +ADD COLUMN updated_at timestamp NOT NULL DEFAULT NOW(); + +ALTER TABLE tags +ADD COLUMN updated_at timestamp NOT NULL DEFAULT NOW(); + +ALTER TABLE protofiles +ADD COLUMN updated_at timestamp NOT NULL DEFAULT NOW(); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +ALTER TABLE protofiles +DROP COLUMN updated_at; + +ALTER TABLE tags +DROP COLUMN updated_at; + +ALTER TABLE modules +DROP COLUMN updated_at; +-- +goose StatementEnd diff --git a/migrations/20231113161748_dependencies.sql b/migrations/20231113161748_dependencies.sql new file mode 100644 index 0000000..5cdb504 --- /dev/null +++ b/migrations/20231113161748_dependencies.sql @@ -0,0 +1,17 @@ +-- +goose Up +-- +goose StatementBegin +CREATE TABLE IF NOT EXISTS dependencies ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + tag_id UUID NOT NULL, + dependency_tag_id UUID NOT NULL, + updated_at TIMESTAMP NOT NULL DEFAULT NOW() +); + +CREATE UNIQUE INDEX IF NOT EXISTS dependencies_tag_id_dependency_tag_id_idx ON dependencies (tag_id, dependency_tag_id); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +DROP INDEX IF EXISTS dependencies_tag_id_dependency_tag_id_idx; +DROP TABLE IF EXISTS dependencies; +-- +goose StatementEnd