From b70132c163b2a57f12271cef8b0d13cd53b37f2f Mon Sep 17 00:00:00 2001 From: Leonardo Cecchi Date: Tue, 16 Jan 2024 13:17:25 +0000 Subject: [PATCH] feat: initial import Signed-off-by: Leonardo Cecchi --- .devcontainer.json | 10 + .github/workflows/continuous-delivery.yml | 29 + .github/workflows/release-please.yml | 18 + .github/workflows/spellcheck.yaml | 14 + Makefile | 11 + go.mod | 16 + go.sum | 20 + pkg/identity/identity.pb.go | 716 +++++++++++++++++ pkg/identity/identity_grpc.pb.go | 189 +++++ pkg/wal/wal.pb.go | 923 ++++++++++++++++++++++ pkg/wal/wal_grpc.pb.go | 228 ++++++ proto/identity.proto | 77 ++ proto/wal.proto | 111 +++ scripts/build.sh | 14 + 14 files changed, 2376 insertions(+) create mode 100644 .devcontainer.json create mode 100644 .github/workflows/continuous-delivery.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/spellcheck.yaml create mode 100644 Makefile create mode 100644 go.mod create mode 100644 go.sum create mode 100644 pkg/identity/identity.pb.go create mode 100644 pkg/identity/identity_grpc.pb.go create mode 100644 pkg/wal/wal.pb.go create mode 100644 pkg/wal/wal_grpc.pb.go create mode 100644 proto/identity.proto create mode 100644 proto/wal.proto create mode 100755 scripts/build.sh diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 0000000..a28c232 --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,10 @@ +{ + "image": "mcr.microsoft.com/devcontainers/go:1-bullseye", + "features": { + "ghcr.io/devcontainers-contrib/features/protoc:1": {} + }, + + // Enable kubectl short alias with completion + "postCreateCommand": "go install google.golang.org/protobuf/cmd/protoc-gen-go@latest; go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest" + } + \ No newline at end of file diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml new file mode 100644 index 0000000..154948a --- /dev/null +++ b/.github/workflows/continuous-delivery.yml @@ -0,0 +1,29 @@ +name: backup-adapter CI +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.0' + - run: make check + name: "Linters" + + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '>=1.19.0' + - run: make test + name: "Unit tests" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..e9e8144 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +on: + push: + branches: + - main +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} +name: release-please +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: go + package-name: backup-adapter + token: ${{secrets.REPO_PAT}} diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml new file mode 100644 index 0000000..320dcee --- /dev/null +++ b/.github/workflows/spellcheck.yaml @@ -0,0 +1,14 @@ +name: spellcheck + +on: + push: + +jobs: + spellcheck: + name: runner / spellcheck + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v2 + - name: Run PySpelling as a GitHub action + uses: sbates130272/spellcheck-github-actions@v0.6.0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cea7900 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +.PHONY: build +build: + ./scripts/build.sh + +.PHONY: check +check: + ./scripts/check.sh + +.PHONY: test +test: + ./scripts/test.sh diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..22f7f47 --- /dev/null +++ b/go.mod @@ -0,0 +1,16 @@ +module github.com/leonardoce/backup-adapter + +go 1.19 + +require ( + google.golang.org/grpc v1.59.0 + google.golang.org/protobuf v1.31.0 +) + +require ( + github.com/golang/protobuf v1.5.3 // indirect + golang.org/x/net v0.14.0 // indirect + golang.org/x/sys v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..1b1e8ef --- /dev/null +++ b/go.sum @@ -0,0 +1,20 @@ +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= +golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/pkg/identity/identity.pb.go b/pkg/identity/identity.pb.go new file mode 100644 index 0000000..2d31339 --- /dev/null +++ b/pkg/identity/identity.pb.go @@ -0,0 +1,716 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.2 +// source: proto/identity.proto + +package identity + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PluginCapability_Service_Type int32 + +const ( + PluginCapability_Service_UNKNOWN PluginCapability_Service_Type = 0 + // WAL_SERVICE indicates that the Plugin provides RPCs for + // the WAL service. Plugins SHOULD provide this capability. + // The presence of this capability determines whether the CO will + // attempt to invoke the REQUIRED WALService RPCs, as well + // as specific RPCs as indicated by GetCapabilities. + PluginCapability_Service_WAL_SERVICE PluginCapability_Service_Type = 1 +) + +// Enum value maps for PluginCapability_Service_Type. +var ( + PluginCapability_Service_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "WAL_SERVICE", + } + PluginCapability_Service_Type_value = map[string]int32{ + "UNKNOWN": 0, + "WAL_SERVICE": 1, + } +) + +func (x PluginCapability_Service_Type) Enum() *PluginCapability_Service_Type { + p := new(PluginCapability_Service_Type) + *p = x + return p +} + +func (x PluginCapability_Service_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PluginCapability_Service_Type) Descriptor() protoreflect.EnumDescriptor { + return file_proto_identity_proto_enumTypes[0].Descriptor() +} + +func (PluginCapability_Service_Type) Type() protoreflect.EnumType { + return &file_proto_identity_proto_enumTypes[0] +} + +func (x PluginCapability_Service_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PluginCapability_Service_Type.Descriptor instead. +func (PluginCapability_Service_Type) EnumDescriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{4, 0, 0} +} + +type GetPluginInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetPluginInfoRequest) Reset() { + *x = GetPluginInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginInfoRequest) ProtoMessage() {} + +func (x *GetPluginInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_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 GetPluginInfoRequest.ProtoReflect.Descriptor instead. +func (*GetPluginInfoRequest) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{0} +} + +type GetPluginInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name MUST follow domain name notation format + // (https://tools.ietf.org/html/rfc1035#section-2.3.1). It SHOULD + // include the plugin's host company name and the plugin name, + // to minimize the possibility of collisions. It MUST be 63 + // characters or less, beginning and ending with an alphanumeric + // character ([a-z0-9A-Z]) with dashes (-), dots (.), and + // alphanumerics between. This field is REQUIRED. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // This field is REQUIRED. Value of this field is opaque. + VendorVersion string `protobuf:"bytes,2,opt,name=vendor_version,json=vendorVersion,proto3" json:"vendor_version,omitempty"` + // This field is OPTIONAL. Values are opaque. + Manifest map[string]string `protobuf:"bytes,3,rep,name=manifest,proto3" json:"manifest,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *GetPluginInfoResponse) Reset() { + *x = GetPluginInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginInfoResponse) ProtoMessage() {} + +func (x *GetPluginInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_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 GetPluginInfoResponse.ProtoReflect.Descriptor instead. +func (*GetPluginInfoResponse) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{1} +} + +func (x *GetPluginInfoResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *GetPluginInfoResponse) GetVendorVersion() string { + if x != nil { + return x.VendorVersion + } + return "" +} + +func (x *GetPluginInfoResponse) GetManifest() map[string]string { + if x != nil { + return x.Manifest + } + return nil +} + +type GetPluginCapabilitiesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetPluginCapabilitiesRequest) Reset() { + *x = GetPluginCapabilitiesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginCapabilitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginCapabilitiesRequest) ProtoMessage() {} + +func (x *GetPluginCapabilitiesRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_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 GetPluginCapabilitiesRequest.ProtoReflect.Descriptor instead. +func (*GetPluginCapabilitiesRequest) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{2} +} + +type GetPluginCapabilitiesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + Capabilities []*PluginCapability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty"` +} + +func (x *GetPluginCapabilitiesResponse) Reset() { + *x = GetPluginCapabilitiesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetPluginCapabilitiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetPluginCapabilitiesResponse) ProtoMessage() {} + +func (x *GetPluginCapabilitiesResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_proto_msgTypes[3] + 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 GetPluginCapabilitiesResponse.ProtoReflect.Descriptor instead. +func (*GetPluginCapabilitiesResponse) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{3} +} + +func (x *GetPluginCapabilitiesResponse) GetCapabilities() []*PluginCapability { + if x != nil { + return x.Capabilities + } + return nil +} + +type PluginCapability struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *PluginCapability_Service_ + Type isPluginCapability_Type `protobuf_oneof:"type"` +} + +func (x *PluginCapability) Reset() { + *x = PluginCapability{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginCapability) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginCapability) ProtoMessage() {} + +func (x *PluginCapability) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_proto_msgTypes[4] + 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 PluginCapability.ProtoReflect.Descriptor instead. +func (*PluginCapability) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{4} +} + +func (m *PluginCapability) GetType() isPluginCapability_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *PluginCapability) GetService() *PluginCapability_Service { + if x, ok := x.GetType().(*PluginCapability_Service_); ok { + return x.Service + } + return nil +} + +type isPluginCapability_Type interface { + isPluginCapability_Type() +} + +type PluginCapability_Service_ struct { + Service *PluginCapability_Service `protobuf:"bytes,1,opt,name=service,proto3,oneof"` +} + +func (*PluginCapability_Service_) isPluginCapability_Type() {} + +type ProbeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ProbeRequest) Reset() { + *x = ProbeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProbeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProbeRequest) ProtoMessage() {} + +func (x *ProbeRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_proto_msgTypes[5] + 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 ProbeRequest.ProtoReflect.Descriptor instead. +func (*ProbeRequest) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{5} +} + +type ProbeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is OPTIONAL. If not present, the caller SHALL assume + // that the plugin is in a ready state and is accepting calls to its + // Controller and/or Node services (according to the plugin's reported + // capabilities). + Ready bool `protobuf:"varint,1,opt,name=ready,proto3" json:"ready,omitempty"` +} + +func (x *ProbeResponse) Reset() { + *x = ProbeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProbeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProbeResponse) ProtoMessage() {} + +func (x *ProbeResponse) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_proto_msgTypes[6] + 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 ProbeResponse.ProtoReflect.Descriptor instead. +func (*ProbeResponse) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{6} +} + +func (x *ProbeResponse) GetReady() bool { + if x != nil { + return x.Ready + } + return false +} + +type PluginCapability_Service struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type PluginCapability_Service_Type `protobuf:"varint,1,opt,name=type,proto3,enum=cnpgi.identity.v1.PluginCapability_Service_Type" json:"type,omitempty"` +} + +func (x *PluginCapability_Service) Reset() { + *x = PluginCapability_Service{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_identity_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PluginCapability_Service) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PluginCapability_Service) ProtoMessage() {} + +func (x *PluginCapability_Service) ProtoReflect() protoreflect.Message { + mi := &file_proto_identity_proto_msgTypes[8] + 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 PluginCapability_Service.ProtoReflect.Descriptor instead. +func (*PluginCapability_Service) Descriptor() ([]byte, []int) { + return file_proto_identity_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *PluginCapability_Service) GetType() PluginCapability_Service_Type { + if x != nil { + return x.Type + } + return PluginCapability_Service_UNKNOWN +} + +var File_proto_identity_proto protoreflect.FileDescriptor + +var file_proto_identity_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0xe3, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 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, + 0x25, 0x0a, 0x0e, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x76, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, + 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, + 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x61, + 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x50, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x22, 0xda, 0x01, 0x0a, 0x10, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x47, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, + 0x75, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, + 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x22, 0x24, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, + 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x41, 0x4c, 0x5f, 0x53, 0x45, 0x52, + 0x56, 0x49, 0x43, 0x45, 0x10, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x0e, + 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x25, + 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x72, 0x65, 0x61, 0x64, 0x79, 0x32, 0xbc, 0x02, 0x0a, 0x08, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x12, 0x64, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x27, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, + 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7c, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x50, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, + 0x73, 0x12, 0x2f, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x05, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x12, + 0x1f, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x20, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x62, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, + 0x67, 0x2f, 0x63, 0x6e, 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_identity_proto_rawDescOnce sync.Once + file_proto_identity_proto_rawDescData = file_proto_identity_proto_rawDesc +) + +func file_proto_identity_proto_rawDescGZIP() []byte { + file_proto_identity_proto_rawDescOnce.Do(func() { + file_proto_identity_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_identity_proto_rawDescData) + }) + return file_proto_identity_proto_rawDescData +} + +var file_proto_identity_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_identity_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_proto_identity_proto_goTypes = []interface{}{ + (PluginCapability_Service_Type)(0), // 0: cnpgi.identity.v1.PluginCapability.Service.Type + (*GetPluginInfoRequest)(nil), // 1: cnpgi.identity.v1.GetPluginInfoRequest + (*GetPluginInfoResponse)(nil), // 2: cnpgi.identity.v1.GetPluginInfoResponse + (*GetPluginCapabilitiesRequest)(nil), // 3: cnpgi.identity.v1.GetPluginCapabilitiesRequest + (*GetPluginCapabilitiesResponse)(nil), // 4: cnpgi.identity.v1.GetPluginCapabilitiesResponse + (*PluginCapability)(nil), // 5: cnpgi.identity.v1.PluginCapability + (*ProbeRequest)(nil), // 6: cnpgi.identity.v1.ProbeRequest + (*ProbeResponse)(nil), // 7: cnpgi.identity.v1.ProbeResponse + nil, // 8: cnpgi.identity.v1.GetPluginInfoResponse.ManifestEntry + (*PluginCapability_Service)(nil), // 9: cnpgi.identity.v1.PluginCapability.Service +} +var file_proto_identity_proto_depIdxs = []int32{ + 8, // 0: cnpgi.identity.v1.GetPluginInfoResponse.manifest:type_name -> cnpgi.identity.v1.GetPluginInfoResponse.ManifestEntry + 5, // 1: cnpgi.identity.v1.GetPluginCapabilitiesResponse.capabilities:type_name -> cnpgi.identity.v1.PluginCapability + 9, // 2: cnpgi.identity.v1.PluginCapability.service:type_name -> cnpgi.identity.v1.PluginCapability.Service + 0, // 3: cnpgi.identity.v1.PluginCapability.Service.type:type_name -> cnpgi.identity.v1.PluginCapability.Service.Type + 1, // 4: cnpgi.identity.v1.Identity.GetPluginInfo:input_type -> cnpgi.identity.v1.GetPluginInfoRequest + 3, // 5: cnpgi.identity.v1.Identity.GetPluginCapabilities:input_type -> cnpgi.identity.v1.GetPluginCapabilitiesRequest + 6, // 6: cnpgi.identity.v1.Identity.Probe:input_type -> cnpgi.identity.v1.ProbeRequest + 2, // 7: cnpgi.identity.v1.Identity.GetPluginInfo:output_type -> cnpgi.identity.v1.GetPluginInfoResponse + 4, // 8: cnpgi.identity.v1.Identity.GetPluginCapabilities:output_type -> cnpgi.identity.v1.GetPluginCapabilitiesResponse + 7, // 9: cnpgi.identity.v1.Identity.Probe:output_type -> cnpgi.identity.v1.ProbeResponse + 7, // [7:10] is the sub-list for method output_type + 4, // [4:7] 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_proto_identity_proto_init() } +func file_proto_identity_proto_init() { + if File_proto_identity_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_identity_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginInfoResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginCapabilitiesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetPluginCapabilitiesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginCapability); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProbeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ProbeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_identity_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PluginCapability_Service); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_proto_identity_proto_msgTypes[4].OneofWrappers = []interface{}{ + (*PluginCapability_Service_)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_identity_proto_rawDesc, + NumEnums: 1, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_identity_proto_goTypes, + DependencyIndexes: file_proto_identity_proto_depIdxs, + EnumInfos: file_proto_identity_proto_enumTypes, + MessageInfos: file_proto_identity_proto_msgTypes, + }.Build() + File_proto_identity_proto = out.File + file_proto_identity_proto_rawDesc = nil + file_proto_identity_proto_goTypes = nil + file_proto_identity_proto_depIdxs = nil +} diff --git a/pkg/identity/identity_grpc.pb.go b/pkg/identity/identity_grpc.pb.go new file mode 100644 index 0000000..b66d443 --- /dev/null +++ b/pkg/identity/identity_grpc.pb.go @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: proto/identity.proto + +package identity + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + Identity_GetPluginInfo_FullMethodName = "/cnpgi.identity.v1.Identity/GetPluginInfo" + Identity_GetPluginCapabilities_FullMethodName = "/cnpgi.identity.v1.Identity/GetPluginCapabilities" + Identity_Probe_FullMethodName = "/cnpgi.identity.v1.Identity/Probe" +) + +// IdentityClient is the client API for Identity service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type IdentityClient interface { + // GetPluginInfo gets the plugin metadata + GetPluginInfo(ctx context.Context, in *GetPluginInfoRequest, opts ...grpc.CallOption) (*GetPluginInfoResponse, error) + // GetPluginCapabilities gets information about this plugin + GetPluginCapabilities(ctx context.Context, in *GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*GetPluginCapabilitiesResponse, error) + // Probe is used to tell if the plugin is ready to receive requests + Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) +} + +type identityClient struct { + cc grpc.ClientConnInterface +} + +func NewIdentityClient(cc grpc.ClientConnInterface) IdentityClient { + return &identityClient{cc} +} + +func (c *identityClient) GetPluginInfo(ctx context.Context, in *GetPluginInfoRequest, opts ...grpc.CallOption) (*GetPluginInfoResponse, error) { + out := new(GetPluginInfoResponse) + err := c.cc.Invoke(ctx, Identity_GetPluginInfo_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityClient) GetPluginCapabilities(ctx context.Context, in *GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*GetPluginCapabilitiesResponse, error) { + out := new(GetPluginCapabilitiesResponse) + err := c.cc.Invoke(ctx, Identity_GetPluginCapabilities_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityClient) Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error) { + out := new(ProbeResponse) + err := c.cc.Invoke(ctx, Identity_Probe_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// IdentityServer is the server API for Identity service. +// All implementations must embed UnimplementedIdentityServer +// for forward compatibility +type IdentityServer interface { + // GetPluginInfo gets the plugin metadata + GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error) + // GetPluginCapabilities gets information about this plugin + GetPluginCapabilities(context.Context, *GetPluginCapabilitiesRequest) (*GetPluginCapabilitiesResponse, error) + // Probe is used to tell if the plugin is ready to receive requests + Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) + mustEmbedUnimplementedIdentityServer() +} + +// UnimplementedIdentityServer must be embedded to have forward compatible implementations. +type UnimplementedIdentityServer struct { +} + +func (UnimplementedIdentityServer) GetPluginInfo(context.Context, *GetPluginInfoRequest) (*GetPluginInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPluginInfo not implemented") +} +func (UnimplementedIdentityServer) GetPluginCapabilities(context.Context, *GetPluginCapabilitiesRequest) (*GetPluginCapabilitiesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPluginCapabilities not implemented") +} +func (UnimplementedIdentityServer) Probe(context.Context, *ProbeRequest) (*ProbeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Probe not implemented") +} +func (UnimplementedIdentityServer) mustEmbedUnimplementedIdentityServer() {} + +// UnsafeIdentityServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to IdentityServer will +// result in compilation errors. +type UnsafeIdentityServer interface { + mustEmbedUnimplementedIdentityServer() +} + +func RegisterIdentityServer(s grpc.ServiceRegistrar, srv IdentityServer) { + s.RegisterService(&Identity_ServiceDesc, srv) +} + +func _Identity_GetPluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).GetPluginInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Identity_GetPluginInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).GetPluginInfo(ctx, req.(*GetPluginInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Identity_GetPluginCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPluginCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).GetPluginCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Identity_GetPluginCapabilities_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).GetPluginCapabilities(ctx, req.(*GetPluginCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Identity_Probe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ProbeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityServer).Probe(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Identity_Probe_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityServer).Probe(ctx, req.(*ProbeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Identity_ServiceDesc is the grpc.ServiceDesc for Identity service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Identity_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cnpgi.identity.v1.Identity", + HandlerType: (*IdentityServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPluginInfo", + Handler: _Identity_GetPluginInfo_Handler, + }, + { + MethodName: "GetPluginCapabilities", + Handler: _Identity_GetPluginCapabilities_Handler, + }, + { + MethodName: "Probe", + Handler: _Identity_Probe_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/identity.proto", +} diff --git a/pkg/wal/wal.pb.go b/pkg/wal/wal.pb.go new file mode 100644 index 0000000..8455688 --- /dev/null +++ b/pkg/wal/wal.pb.go @@ -0,0 +1,923 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.2 +// source: proto/wal.proto + +package wal + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type WALCapability_RPC_Type int32 + +const ( + WALCapability_RPC_UNKNOWN WALCapability_RPC_Type = 0 + // ARCHIVE_WAL indicates that the Plugin is able to + // reply to the Archive RPC request + WALCapability_RPC_ARCHIVE_WAL WALCapability_RPC_Type = 1 + // RESTORE_WAL indicates that the Plugin is able to + // reply to the Restore RPC request + WALCapability_RPC_RESTORE_WAL WALCapability_RPC_Type = 2 + // STATUS indicates that the Plugin is able to + // reply to the Status RPC request + WALCapability_RPC_STATUS WALCapability_RPC_Type = 3 +) + +// Enum value maps for WALCapability_RPC_Type. +var ( + WALCapability_RPC_Type_name = map[int32]string{ + 0: "UNKNOWN", + 1: "ARCHIVE_WAL", + 2: "RESTORE_WAL", + 3: "STATUS", + } + WALCapability_RPC_Type_value = map[string]int32{ + "UNKNOWN": 0, + "ARCHIVE_WAL": 1, + "RESTORE_WAL": 2, + "STATUS": 3, + } +) + +func (x WALCapability_RPC_Type) Enum() *WALCapability_RPC_Type { + p := new(WALCapability_RPC_Type) + *p = x + return p +} + +func (x WALCapability_RPC_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WALCapability_RPC_Type) Descriptor() protoreflect.EnumDescriptor { + return file_proto_wal_proto_enumTypes[0].Descriptor() +} + +func (WALCapability_RPC_Type) Type() protoreflect.EnumType { + return &file_proto_wal_proto_enumTypes[0] +} + +func (x WALCapability_RPC_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WALCapability_RPC_Type.Descriptor instead. +func (WALCapability_RPC_Type) EnumDescriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{8, 0, 0} +} + +type WALArchiveRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + ClusterName string `protobuf:"bytes,1,opt,name=clusterName,proto3" json:"clusterName,omitempty"` + // This field is REQUIRED. Value of this field is the full path + // of the WAL file that should be archived + SourceFileName string `protobuf:"bytes,2,opt,name=sourceFileName,proto3" json:"sourceFileName,omitempty"` + // This field is OPTIONAL. Values are opaque. + Parameters map[string]string `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *WALArchiveRequest) Reset() { + *x = WALArchiveRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALArchiveRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALArchiveRequest) ProtoMessage() {} + +func (x *WALArchiveRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_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 WALArchiveRequest.ProtoReflect.Descriptor instead. +func (*WALArchiveRequest) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{0} +} + +func (x *WALArchiveRequest) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *WALArchiveRequest) GetSourceFileName() string { + if x != nil { + return x.SourceFileName + } + return "" +} + +func (x *WALArchiveRequest) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +type WALArchiveResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WALArchiveResult) Reset() { + *x = WALArchiveResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALArchiveResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALArchiveResult) ProtoMessage() {} + +func (x *WALArchiveResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_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 WALArchiveResult.ProtoReflect.Descriptor instead. +func (*WALArchiveResult) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{1} +} + +type WALRestoreRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + ClusterName string `protobuf:"bytes,1,opt,name=clusterName,proto3" json:"clusterName,omitempty"` + // This field is REQUIRED. Value of this field is the name of + // the WAL to be retrieved from the archive, such as: + // 000000010000000100000012 + SourceWalName string `protobuf:"bytes,2,opt,name=sourceWalName,proto3" json:"sourceWalName,omitempty"` + // This field is REQUIRED. Value of this field is the full path + // where the WAL file should be stored + DestinationFileName string `protobuf:"bytes,3,opt,name=destinationFileName,proto3" json:"destinationFileName,omitempty"` + // This field is OPTIONAL. Values are opaque. + Parameters map[string]string `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *WALRestoreRequest) Reset() { + *x = WALRestoreRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALRestoreRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALRestoreRequest) ProtoMessage() {} + +func (x *WALRestoreRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_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 WALRestoreRequest.ProtoReflect.Descriptor instead. +func (*WALRestoreRequest) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{2} +} + +func (x *WALRestoreRequest) GetClusterName() string { + if x != nil { + return x.ClusterName + } + return "" +} + +func (x *WALRestoreRequest) GetSourceWalName() string { + if x != nil { + return x.SourceWalName + } + return "" +} + +func (x *WALRestoreRequest) GetDestinationFileName() string { + if x != nil { + return x.DestinationFileName + } + return "" +} + +func (x *WALRestoreRequest) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +type WALRestoreResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WALRestoreResult) Reset() { + *x = WALRestoreResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALRestoreResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALRestoreResult) ProtoMessage() {} + +func (x *WALRestoreResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[3] + 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 WALRestoreResult.ProtoReflect.Descriptor instead. +func (*WALRestoreResult) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{3} +} + +type WALStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WALStatusRequest) Reset() { + *x = WALStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALStatusRequest) ProtoMessage() {} + +func (x *WALStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[4] + 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 WALStatusRequest.ProtoReflect.Descriptor instead. +func (*WALStatusRequest) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{4} +} + +type WALStatusResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // This field is REQUIRED. Value of this field is the base name of + // the oldest archived WAL, such as: + // 000000010000000100000012 + FirstWAL string `protobuf:"bytes,1,opt,name=firstWAL,proto3" json:"firstWAL,omitempty"` + // This field is REQUIRED. Value of this field is the base name of + // the newest archived WAL, such as: + // 000000010000000100000014 + LastWAL string `protobuf:"bytes,2,opt,name=lastWAL,proto3" json:"lastWAL,omitempty"` + // This field is OPTIONAL. Value is opaque. + AdditionalInformation map[string]string `protobuf:"bytes,4,rep,name=additionalInformation,proto3" json:"additionalInformation,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *WALStatusResult) Reset() { + *x = WALStatusResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALStatusResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALStatusResult) ProtoMessage() {} + +func (x *WALStatusResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[5] + 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 WALStatusResult.ProtoReflect.Descriptor instead. +func (*WALStatusResult) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{5} +} + +func (x *WALStatusResult) GetFirstWAL() string { + if x != nil { + return x.FirstWAL + } + return "" +} + +func (x *WALStatusResult) GetLastWAL() string { + if x != nil { + return x.LastWAL + } + return "" +} + +func (x *WALStatusResult) GetAdditionalInformation() map[string]string { + if x != nil { + return x.AdditionalInformation + } + return nil +} + +type WALCapabilitiesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *WALCapabilitiesRequest) Reset() { + *x = WALCapabilitiesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALCapabilitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALCapabilitiesRequest) ProtoMessage() {} + +func (x *WALCapabilitiesRequest) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[6] + 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 WALCapabilitiesRequest.ProtoReflect.Descriptor instead. +func (*WALCapabilitiesRequest) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{6} +} + +type WALCapabilitiesResult struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + Capabilities []*WALCapability `protobuf:"bytes,1,rep,name=capabilities,proto3" json:"capabilities,omitempty"` +} + +func (x *WALCapabilitiesResult) Reset() { + *x = WALCapabilitiesResult{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALCapabilitiesResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALCapabilitiesResult) ProtoMessage() {} + +func (x *WALCapabilitiesResult) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[7] + 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 WALCapabilitiesResult.ProtoReflect.Descriptor instead. +func (*WALCapabilitiesResult) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{7} +} + +func (x *WALCapabilitiesResult) GetCapabilities() []*WALCapability { + if x != nil { + return x.Capabilities + } + return nil +} + +type WALCapability struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Type: + // + // *WALCapability_Rpc + Type isWALCapability_Type `protobuf_oneof:"type"` +} + +func (x *WALCapability) Reset() { + *x = WALCapability{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALCapability) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALCapability) ProtoMessage() {} + +func (x *WALCapability) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[8] + 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 WALCapability.ProtoReflect.Descriptor instead. +func (*WALCapability) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{8} +} + +func (m *WALCapability) GetType() isWALCapability_Type { + if m != nil { + return m.Type + } + return nil +} + +func (x *WALCapability) GetRpc() *WALCapability_RPC { + if x, ok := x.GetType().(*WALCapability_Rpc); ok { + return x.Rpc + } + return nil +} + +type isWALCapability_Type interface { + isWALCapability_Type() +} + +type WALCapability_Rpc struct { + Rpc *WALCapability_RPC `protobuf:"bytes,1,opt,name=rpc,proto3,oneof"` +} + +func (*WALCapability_Rpc) isWALCapability_Type() {} + +type WALCapability_RPC struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type WALCapability_RPC_Type `protobuf:"varint,1,opt,name=type,proto3,enum=cnpgi.adapter.v1.WALCapability_RPC_Type" json:"type,omitempty"` +} + +func (x *WALCapability_RPC) Reset() { + *x = WALCapability_RPC{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_wal_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WALCapability_RPC) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WALCapability_RPC) ProtoMessage() {} + +func (x *WALCapability_RPC) ProtoReflect() protoreflect.Message { + mi := &file_proto_wal_proto_msgTypes[12] + 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 WALCapability_RPC.ProtoReflect.Descriptor instead. +func (*WALCapability_RPC) Descriptor() ([]byte, []int) { + return file_proto_wal_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *WALCapability_RPC) GetType() WALCapability_RPC_Type { + if x != nil { + return x.Type + } + return WALCapability_RPC_UNKNOWN +} + +var File_proto_wal_proto protoreflect.FileDescriptor + +var file_proto_wal_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x77, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x10, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x22, 0xf1, 0x01, 0x0a, 0x11, 0x57, 0x41, 0x4c, 0x41, 0x72, 0x63, 0x68, 0x69, + 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, + 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x41, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x12, 0x0a, 0x10, 0x57, 0x41, 0x4c, 0x41, 0x72, + 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xa1, 0x02, 0x0a, 0x11, + 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x57, 0x61, 0x6c, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x57, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0a, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x33, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x12, 0x0a, 0x10, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x85, 0x02, 0x0a, 0x0f, 0x57, 0x41, 0x4c, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, + 0x69, 0x72, 0x73, 0x74, 0x57, 0x41, 0x4c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, + 0x69, 0x72, 0x73, 0x74, 0x57, 0x41, 0x4c, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x57, + 0x41, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x61, 0x73, 0x74, 0x57, 0x41, + 0x4c, 0x12, 0x72, 0x0a, 0x15, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3c, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x2e, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, + 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x15, + 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x48, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x18, 0x0a, 0x16, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5c, 0x0a, 0x15, 0x57, 0x41, 0x4c, + 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x12, 0x43, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, + 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xd9, 0x01, 0x0a, 0x0d, 0x57, 0x41, 0x4c, 0x43, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x03, 0x72, 0x70, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, + 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, + 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x48, 0x00, 0x52, 0x03, 0x72, + 0x70, 0x63, 0x1a, 0x86, 0x01, 0x0a, 0x03, 0x52, 0x50, 0x43, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, + 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, + 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x52, 0x50, 0x43, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x41, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, + 0x0b, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0f, + 0x0a, 0x0b, 0x52, 0x45, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x10, 0x02, 0x12, + 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x10, 0x03, 0x42, 0x06, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x32, 0xec, 0x02, 0x0a, 0x03, 0x57, 0x41, 0x4c, 0x12, 0x54, 0x0a, 0x07, 0x41, + 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, + 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x41, 0x72, 0x63, + 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6e, + 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, + 0x41, 0x4c, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x00, 0x12, 0x54, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x23, 0x2e, 0x63, + 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, + 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x28, 0x2e, + 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6e, 0x70, 0x67, 0x69, 0x2e, + 0x61, 0x64, 0x61, 0x70, 0x74, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x41, 0x4c, 0x43, 0x61, + 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x22, 0x00, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x2d, 0x70, 0x67, 0x2f, + 0x63, 0x6e, 0x70, 0x67, 0x2d, 0x69, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x77, 0x61, 0x6c, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_wal_proto_rawDescOnce sync.Once + file_proto_wal_proto_rawDescData = file_proto_wal_proto_rawDesc +) + +func file_proto_wal_proto_rawDescGZIP() []byte { + file_proto_wal_proto_rawDescOnce.Do(func() { + file_proto_wal_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_wal_proto_rawDescData) + }) + return file_proto_wal_proto_rawDescData +} + +var file_proto_wal_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_proto_wal_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_proto_wal_proto_goTypes = []interface{}{ + (WALCapability_RPC_Type)(0), // 0: cnpgi.adapter.v1.WALCapability.RPC.Type + (*WALArchiveRequest)(nil), // 1: cnpgi.adapter.v1.WALArchiveRequest + (*WALArchiveResult)(nil), // 2: cnpgi.adapter.v1.WALArchiveResult + (*WALRestoreRequest)(nil), // 3: cnpgi.adapter.v1.WALRestoreRequest + (*WALRestoreResult)(nil), // 4: cnpgi.adapter.v1.WALRestoreResult + (*WALStatusRequest)(nil), // 5: cnpgi.adapter.v1.WALStatusRequest + (*WALStatusResult)(nil), // 6: cnpgi.adapter.v1.WALStatusResult + (*WALCapabilitiesRequest)(nil), // 7: cnpgi.adapter.v1.WALCapabilitiesRequest + (*WALCapabilitiesResult)(nil), // 8: cnpgi.adapter.v1.WALCapabilitiesResult + (*WALCapability)(nil), // 9: cnpgi.adapter.v1.WALCapability + nil, // 10: cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry + nil, // 11: cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry + nil, // 12: cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry + (*WALCapability_RPC)(nil), // 13: cnpgi.adapter.v1.WALCapability.RPC +} +var file_proto_wal_proto_depIdxs = []int32{ + 10, // 0: cnpgi.adapter.v1.WALArchiveRequest.parameters:type_name -> cnpgi.adapter.v1.WALArchiveRequest.ParametersEntry + 11, // 1: cnpgi.adapter.v1.WALRestoreRequest.parameters:type_name -> cnpgi.adapter.v1.WALRestoreRequest.ParametersEntry + 12, // 2: cnpgi.adapter.v1.WALStatusResult.additionalInformation:type_name -> cnpgi.adapter.v1.WALStatusResult.AdditionalInformationEntry + 9, // 3: cnpgi.adapter.v1.WALCapabilitiesResult.capabilities:type_name -> cnpgi.adapter.v1.WALCapability + 13, // 4: cnpgi.adapter.v1.WALCapability.rpc:type_name -> cnpgi.adapter.v1.WALCapability.RPC + 0, // 5: cnpgi.adapter.v1.WALCapability.RPC.type:type_name -> cnpgi.adapter.v1.WALCapability.RPC.Type + 1, // 6: cnpgi.adapter.v1.WAL.Archive:input_type -> cnpgi.adapter.v1.WALArchiveRequest + 3, // 7: cnpgi.adapter.v1.WAL.Restore:input_type -> cnpgi.adapter.v1.WALRestoreRequest + 5, // 8: cnpgi.adapter.v1.WAL.Status:input_type -> cnpgi.adapter.v1.WALStatusRequest + 7, // 9: cnpgi.adapter.v1.WAL.GetCapabilities:input_type -> cnpgi.adapter.v1.WALCapabilitiesRequest + 2, // 10: cnpgi.adapter.v1.WAL.Archive:output_type -> cnpgi.adapter.v1.WALArchiveResult + 4, // 11: cnpgi.adapter.v1.WAL.Restore:output_type -> cnpgi.adapter.v1.WALRestoreResult + 6, // 12: cnpgi.adapter.v1.WAL.Status:output_type -> cnpgi.adapter.v1.WALStatusResult + 8, // 13: cnpgi.adapter.v1.WAL.GetCapabilities:output_type -> cnpgi.adapter.v1.WALCapabilitiesResult + 10, // [10:14] is the sub-list for method output_type + 6, // [6:10] 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_proto_wal_proto_init() } +func file_proto_wal_proto_init() { + if File_proto_wal_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_wal_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALArchiveRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALArchiveResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALRestoreRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALRestoreResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALStatusResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapabilitiesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapabilitiesResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapability); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_wal_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WALCapability_RPC); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_proto_wal_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*WALCapability_Rpc)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_wal_proto_rawDesc, + NumEnums: 1, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_wal_proto_goTypes, + DependencyIndexes: file_proto_wal_proto_depIdxs, + EnumInfos: file_proto_wal_proto_enumTypes, + MessageInfos: file_proto_wal_proto_msgTypes, + }.Build() + File_proto_wal_proto = out.File + file_proto_wal_proto_rawDesc = nil + file_proto_wal_proto_goTypes = nil + file_proto_wal_proto_depIdxs = nil +} diff --git a/pkg/wal/wal_grpc.pb.go b/pkg/wal/wal_grpc.pb.go new file mode 100644 index 0000000..5610e08 --- /dev/null +++ b/pkg/wal/wal_grpc.pb.go @@ -0,0 +1,228 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: proto/wal.proto + +package wal + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + WAL_Archive_FullMethodName = "/cnpgi.adapter.v1.WAL/Archive" + WAL_Restore_FullMethodName = "/cnpgi.adapter.v1.WAL/Restore" + WAL_Status_FullMethodName = "/cnpgi.adapter.v1.WAL/Status" + WAL_GetCapabilities_FullMethodName = "/cnpgi.adapter.v1.WAL/GetCapabilities" +) + +// WALClient is the client API for WAL service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type WALClient interface { + // Archive copies one WAL file into the archive + Archive(ctx context.Context, in *WALArchiveRequest, opts ...grpc.CallOption) (*WALArchiveResult, error) + // Restores copies WAL file from the archive to the data directory + Restore(ctx context.Context, in *WALRestoreRequest, opts ...grpc.CallOption) (*WALRestoreResult, error) + // Status gets the statistics of the WAL file archive + Status(ctx context.Context, in *WALStatusRequest, opts ...grpc.CallOption) (*WALStatusResult, error) + // GetCapabilities gets the capabilities of the WAL service + GetCapabilities(ctx context.Context, in *WALCapabilitiesRequest, opts ...grpc.CallOption) (*WALCapabilitiesResult, error) +} + +type wALClient struct { + cc grpc.ClientConnInterface +} + +func NewWALClient(cc grpc.ClientConnInterface) WALClient { + return &wALClient{cc} +} + +func (c *wALClient) Archive(ctx context.Context, in *WALArchiveRequest, opts ...grpc.CallOption) (*WALArchiveResult, error) { + out := new(WALArchiveResult) + err := c.cc.Invoke(ctx, WAL_Archive_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wALClient) Restore(ctx context.Context, in *WALRestoreRequest, opts ...grpc.CallOption) (*WALRestoreResult, error) { + out := new(WALRestoreResult) + err := c.cc.Invoke(ctx, WAL_Restore_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wALClient) Status(ctx context.Context, in *WALStatusRequest, opts ...grpc.CallOption) (*WALStatusResult, error) { + out := new(WALStatusResult) + err := c.cc.Invoke(ctx, WAL_Status_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *wALClient) GetCapabilities(ctx context.Context, in *WALCapabilitiesRequest, opts ...grpc.CallOption) (*WALCapabilitiesResult, error) { + out := new(WALCapabilitiesResult) + err := c.cc.Invoke(ctx, WAL_GetCapabilities_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// WALServer is the server API for WAL service. +// All implementations must embed UnimplementedWALServer +// for forward compatibility +type WALServer interface { + // Archive copies one WAL file into the archive + Archive(context.Context, *WALArchiveRequest) (*WALArchiveResult, error) + // Restores copies WAL file from the archive to the data directory + Restore(context.Context, *WALRestoreRequest) (*WALRestoreResult, error) + // Status gets the statistics of the WAL file archive + Status(context.Context, *WALStatusRequest) (*WALStatusResult, error) + // GetCapabilities gets the capabilities of the WAL service + GetCapabilities(context.Context, *WALCapabilitiesRequest) (*WALCapabilitiesResult, error) + mustEmbedUnimplementedWALServer() +} + +// UnimplementedWALServer must be embedded to have forward compatible implementations. +type UnimplementedWALServer struct { +} + +func (UnimplementedWALServer) Archive(context.Context, *WALArchiveRequest) (*WALArchiveResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method Archive not implemented") +} +func (UnimplementedWALServer) Restore(context.Context, *WALRestoreRequest) (*WALRestoreResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method Restore not implemented") +} +func (UnimplementedWALServer) Status(context.Context, *WALStatusRequest) (*WALStatusResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedWALServer) GetCapabilities(context.Context, *WALCapabilitiesRequest) (*WALCapabilitiesResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCapabilities not implemented") +} +func (UnimplementedWALServer) mustEmbedUnimplementedWALServer() {} + +// UnsafeWALServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to WALServer will +// result in compilation errors. +type UnsafeWALServer interface { + mustEmbedUnimplementedWALServer() +} + +func RegisterWALServer(s grpc.ServiceRegistrar, srv WALServer) { + s.RegisterService(&WAL_ServiceDesc, srv) +} + +func _WAL_Archive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WALArchiveRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WALServer).Archive(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WAL_Archive_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WALServer).Archive(ctx, req.(*WALArchiveRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WAL_Restore_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WALRestoreRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WALServer).Restore(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WAL_Restore_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WALServer).Restore(ctx, req.(*WALRestoreRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WAL_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WALStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WALServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WAL_Status_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WALServer).Status(ctx, req.(*WALStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WAL_GetCapabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(WALCapabilitiesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WALServer).GetCapabilities(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WAL_GetCapabilities_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WALServer).GetCapabilities(ctx, req.(*WALCapabilitiesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// WAL_ServiceDesc is the grpc.ServiceDesc for WAL service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var WAL_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cnpgi.adapter.v1.WAL", + HandlerType: (*WALServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Archive", + Handler: _WAL_Archive_Handler, + }, + { + MethodName: "Restore", + Handler: _WAL_Restore_Handler, + }, + { + MethodName: "Status", + Handler: _WAL_Status_Handler, + }, + { + MethodName: "GetCapabilities", + Handler: _WAL_GetCapabilities_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/wal.proto", +} diff --git a/proto/identity.proto b/proto/identity.proto new file mode 100644 index 0000000..a3b9c29 --- /dev/null +++ b/proto/identity.proto @@ -0,0 +1,77 @@ +syntax = "proto3"; +package cnpgi.identity.v1; +option go_package = "github.com/cloudnative-pg/cnpg-i/pkg/identity"; + +service Identity { + // GetPluginInfo gets the plugin metadata + rpc GetPluginInfo(GetPluginInfoRequest) returns (GetPluginInfoResponse) {} + + // GetPluginCapabilities gets information about this plugin + rpc GetPluginCapabilities(GetPluginCapabilitiesRequest) returns (GetPluginCapabilitiesResponse) {} + + // Probe is used to tell if the plugin is ready to receive requests + rpc Probe (ProbeRequest) returns (ProbeResponse) {} +} + +message GetPluginInfoRequest { + // Intentionally empty. +} + +message GetPluginInfoResponse { + // The name MUST follow domain name notation format + // (https://tools.ietf.org/html/rfc1035#section-2.3.1). It SHOULD + // include the plugin's host company name and the plugin name, + // to minimize the possibility of collisions. It MUST be 63 + // characters or less, beginning and ending with an alphanumeric + // character ([a-z0-9A-Z]) with dashes (-), dots (.), and + // alphanumerics between. This field is REQUIRED. + string name = 1; + + // This field is REQUIRED. Value of this field is opaque. + string vendor_version = 2; + + // This field is OPTIONAL. Values are opaque. + map manifest = 3; +} + +message GetPluginCapabilitiesRequest { + // Intentionally empty. +} + +message GetPluginCapabilitiesResponse { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated PluginCapability capabilities = 1; +} + +message PluginCapability { + message Service { + enum Type { + UNKNOWN = 0; + + // WAL_SERVICE indicates that the Plugin provides RPCs for + // the WAL service. Plugins SHOULD provide this capability. + // The presence of this capability determines whether the CO will + // attempt to invoke the REQUIRED WALService RPCs, as well + // as specific RPCs as indicated by GetCapabilities. + WAL_SERVICE = 1; + } + Type type = 1; + } + + oneof type { + Service service = 1; + } +} + +message ProbeRequest { + // Intentionally empty. +} + +message ProbeResponse { + // This field is OPTIONAL. If not present, the caller SHALL assume + // that the plugin is in a ready state and is accepting calls to its + // Controller and/or Node services (according to the plugin's reported + // capabilities). + bool ready = 1; +} diff --git a/proto/wal.proto b/proto/wal.proto new file mode 100644 index 0000000..57ed9ef --- /dev/null +++ b/proto/wal.proto @@ -0,0 +1,111 @@ +syntax = "proto3"; +package cnpgi.adapter.v1; +option go_package = "github.com/cloudnative-pg/cnpg-i/pkg/wal"; + +service WAL { + // Archive copies one WAL file into the archive + rpc Archive(WALArchiveRequest) returns (WALArchiveResult) {} + + // Restores copies WAL file from the archive to the data directory + rpc Restore(WALRestoreRequest) returns (WALRestoreResult) {} + + // Status gets the statistics of the WAL file archive + rpc Status(WALStatusRequest) returns (WALStatusResult) {} + + // GetCapabilities gets the capabilities of the WAL service + rpc GetCapabilities(WALCapabilitiesRequest) returns (WALCapabilitiesResult) {} +} + +message WALArchiveRequest { + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + string clusterName = 1; + + // This field is REQUIRED. Value of this field is the full path + // of the WAL file that should be archived + string sourceFileName = 2; + + // This field is OPTIONAL. Values are opaque. + map parameters = 3; +} + +message WALArchiveResult { + // Intentionally empty. +} + +message WALRestoreRequest { + // This field is REQUIRED. Value of this field is the name of + // the CNPG cluster for which the WAL should be archived + string clusterName = 1; + + // This field is REQUIRED. Value of this field is the name of + // the WAL to be retrieved from the archive, such as: + // 000000010000000100000012 + string sourceWalName = 2; + + // This field is REQUIRED. Value of this field is the full path + // where the WAL file should be stored + string destinationFileName = 3; + + // This field is OPTIONAL. Values are opaque. + map parameters = 4; +} + +message WALRestoreResult { + // Intentionally empty. +} + +message WALStatusRequest { + // Intentionally empty. +} + +message WALStatusResult { + // This field is REQUIRED. Value of this field is the base name of + // the oldest archived WAL, such as: + // 000000010000000100000012 + string firstWAL = 1; + + // This field is REQUIRED. Value of this field is the base name of + // the newest archived WAL, such as: + // 000000010000000100000014 + string lastWAL = 2; + + // This field is OPTIONAL. Value is opaque. + map additionalInformation = 4; +} + +message WALCapabilitiesRequest { + // Intentionally empty. +} + +message WALCapabilitiesResult { + // All the capabilities that the controller service supports. This + // field is OPTIONAL. + repeated WALCapability capabilities = 1; +} + +message WALCapability { + message RPC { + enum Type { + UNKNOWN = 0; + + // ARCHIVE_WAL indicates that the Plugin is able to + // reply to the Archive RPC request + ARCHIVE_WAL = 1; + + // RESTORE_WAL indicates that the Plugin is able to + // reply to the Restore RPC request + RESTORE_WAL = 2; + + // STATUS indicates that the Plugin is able to + // reply to the Status RPC request + STATUS = 3; + } + + Type type = 1; + } + + oneof type { + RPC rpc = 1; + } +} diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000..ef2f57b --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")/.." || exit + +# Recompile protobuf specification +protoc --go_out=. --go_opt=module=github.com/cloudnative-pg/cnpg-i \ + --go-grpc_out=. --go-grpc_opt=module=github.com/cloudnative-pg/cnpg-i \ + proto/wal.proto +protoc --go_out=. --go_opt=module=github.com/cloudnative-pg/cnpg-i \ + --go-grpc_out=. --go-grpc_opt=module=github.com/cloudnative-pg/cnpg-i \ + proto/identity.proto + +# Compile client +go build `go list ./... | grep -v 'vendor'`