From 23789d53c3273119143e27ce32e9ea112bbb25b8 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:13:56 +0300 Subject: [PATCH 1/6] wip --- Makefile | 4 +- go.mod | 32 +- go.sum | 96 +- managedplugin/download.go | 220 ++ managedplugin/download_test.go | 34 + managedplugin/log_reader.go | 59 + managedplugin/log_reader_test.go | 115 + managedplugin/logging.go | 22 + managedplugin/plugin.go | 275 +++ managedplugin/random.go | 27 + managedplugin/registry.go | 49 + managedplugin/registry_test.go | 36 + managedplugin/unix.go | 49 + managedplugin/windows.go | 33 + metrics/metrics.go | 2 +- pb/discovery/v1/discovery.pb.go | 261 +++ pb/discovery/v1/discovery_grpc.pb.go | 107 + pb/plugin/v3/plugin.pb.go | 2049 +++++++++++++++++ pb/plugin/v3/plugin_grpc.pb.go | 397 ++++ pb/specs/v1/spec.pb.go | 716 ++++++ specs/{ => v0}/backend.go | 0 specs/{ => v0}/backend_test.go | 0 specs/{ => v0}/destination.go | 0 specs/{ => v0}/destination_test.go | 0 specs/{ => v0}/doc.go | 0 specs/{ => v0}/migrate_mode.go | 0 specs/{ => v0}/migrate_mode_test.go | 0 specs/{ => v0}/pk_mode.go | 0 specs/{ => v0}/pk_mode_test.go | 0 specs/v0/registry.go | 30 + specs/{ => v0}/registry_test.go | 0 specs/{ => v0}/scheduler.go | 0 specs/{ => v0}/scheduler_test.go | 0 specs/{ => v0}/source.go | 0 specs/{ => v0}/source_test.go | 0 specs/{ => v0}/spec.go | 0 specs/{ => v0}/spec_reader.go | 0 specs/{ => v0}/spec_reader_test.go | 0 specs/{ => v0}/testdata/creds.txt | 0 specs/{ => v0}/testdata/creds1.txt | 0 specs/{ => v0}/testdata/dir/aws.yml | 0 specs/{ => v0}/testdata/dir/postgresql.yml | 0 specs/{ => v0}/testdata/dir_yaml/aws.yaml | 0 .../testdata/dir_yaml/postgresql.yaml | 0 .../testdata/env_variable_in_string.yml | 0 specs/{ => v0}/testdata/env_variables.yml | 0 specs/{ => v0}/testdata/gcp.yml | 0 specs/{ => v0}/testdata/gcpv2.yml | 0 specs/{ => v0}/testdata/multiple_sources.yml | 0 specs/{ => v0}/testdata/number.txt | 0 specs/{ => v0}/testdata/numbers.yml | 0 specs/{ => v0}/write_mode.go | 0 specs/{ => v0}/write_mode_test.go | 0 specs/v1/migrate_mode.go | 50 + specs/v1/migrate_mode_test.go | 33 + specs/v1/pk_mode.go | 50 + specs/v1/pk_mode_test.go | 49 + specs/v1/plugin.go | 97 + specs/v1/plugin_test.go | 270 +++ specs/{ => v1}/registry.go | 0 specs/v1/registry_test.go | 36 + specs/v1/scheduler.go | 60 + specs/v1/scheduler_test.go | 36 + specs/v1/spec.go | 100 + specs/v1/sync.go | 18 + specs/v1/write.go | 9 + specs/v1/write_mode.go | 53 + specs/v1/write_mode_test.go | 33 + state/client.go | 1 + 69 files changed, 5500 insertions(+), 8 deletions(-) create mode 100644 managedplugin/download.go create mode 100644 managedplugin/download_test.go create mode 100644 managedplugin/log_reader.go create mode 100644 managedplugin/log_reader_test.go create mode 100644 managedplugin/logging.go create mode 100644 managedplugin/plugin.go create mode 100644 managedplugin/random.go create mode 100644 managedplugin/registry.go create mode 100644 managedplugin/registry_test.go create mode 100644 managedplugin/unix.go create mode 100644 managedplugin/windows.go create mode 100644 pb/discovery/v1/discovery.pb.go create mode 100644 pb/discovery/v1/discovery_grpc.pb.go create mode 100644 pb/plugin/v3/plugin.pb.go create mode 100644 pb/plugin/v3/plugin_grpc.pb.go create mode 100644 pb/specs/v1/spec.pb.go rename specs/{ => v0}/backend.go (100%) rename specs/{ => v0}/backend_test.go (100%) rename specs/{ => v0}/destination.go (100%) rename specs/{ => v0}/destination_test.go (100%) rename specs/{ => v0}/doc.go (100%) rename specs/{ => v0}/migrate_mode.go (100%) rename specs/{ => v0}/migrate_mode_test.go (100%) rename specs/{ => v0}/pk_mode.go (100%) rename specs/{ => v0}/pk_mode_test.go (100%) create mode 100644 specs/v0/registry.go rename specs/{ => v0}/registry_test.go (100%) rename specs/{ => v0}/scheduler.go (100%) rename specs/{ => v0}/scheduler_test.go (100%) rename specs/{ => v0}/source.go (100%) rename specs/{ => v0}/source_test.go (100%) rename specs/{ => v0}/spec.go (100%) rename specs/{ => v0}/spec_reader.go (100%) rename specs/{ => v0}/spec_reader_test.go (100%) rename specs/{ => v0}/testdata/creds.txt (100%) rename specs/{ => v0}/testdata/creds1.txt (100%) rename specs/{ => v0}/testdata/dir/aws.yml (100%) rename specs/{ => v0}/testdata/dir/postgresql.yml (100%) rename specs/{ => v0}/testdata/dir_yaml/aws.yaml (100%) rename specs/{ => v0}/testdata/dir_yaml/postgresql.yaml (100%) rename specs/{ => v0}/testdata/env_variable_in_string.yml (100%) rename specs/{ => v0}/testdata/env_variables.yml (100%) rename specs/{ => v0}/testdata/gcp.yml (100%) rename specs/{ => v0}/testdata/gcpv2.yml (100%) rename specs/{ => v0}/testdata/multiple_sources.yml (100%) rename specs/{ => v0}/testdata/number.txt (100%) rename specs/{ => v0}/testdata/numbers.yml (100%) rename specs/{ => v0}/write_mode.go (100%) rename specs/{ => v0}/write_mode_test.go (100%) create mode 100644 specs/v1/migrate_mode.go create mode 100644 specs/v1/migrate_mode_test.go create mode 100644 specs/v1/pk_mode.go create mode 100644 specs/v1/pk_mode_test.go create mode 100644 specs/v1/plugin.go create mode 100644 specs/v1/plugin_test.go rename specs/{ => v1}/registry.go (100%) create mode 100644 specs/v1/registry_test.go create mode 100644 specs/v1/scheduler.go create mode 100644 specs/v1/scheduler_test.go create mode 100644 specs/v1/spec.go create mode 100644 specs/v1/sync.go create mode 100644 specs/v1/write.go create mode 100644 specs/v1/write_mode.go create mode 100644 specs/v1/write_mode_test.go create mode 100644 state/client.go diff --git a/Makefile b/Makefile index 9d827f37..7bcbd183 100644 --- a/Makefile +++ b/Makefile @@ -17,4 +17,6 @@ gen-proto: protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/base/v0/base.proto plugin-pb/destination/v0/destination.proto plugin-pb/source/v0/source.proto protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/source/v1/source.proto protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/source/v2/source.proto - protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/destination/v1/destination.proto \ No newline at end of file + protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/destination/v1/destination.proto + protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/plugin/v3/plugin.proto + protoc --proto_path=. --go_out . --go_opt=module="github.com/cloudquery/plugin-pb-go" --go-grpc_out=. --go-grpc_opt=module="github.com/cloudquery/plugin-pb-go" plugin-pb/discovery/v1/discovery.proto \ No newline at end of file diff --git a/go.mod b/go.mod index 60c44b25..c389df30 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,49 @@ module github.com/cloudquery/plugin-pb-go go 1.19 require ( + github.com/apache/arrow/go/v13 v13.0.0-20230601214540-018e7d3f9c4b + github.com/avast/retry-go/v4 v4.3.4 github.com/ghodss/yaml v1.0.0 github.com/google/go-cmp v0.5.9 - github.com/stretchr/testify v1.4.0 + github.com/rs/zerolog v1.29.1 + github.com/schollz/progressbar/v3 v3.13.1 + github.com/stretchr/testify v1.8.2 github.com/thoas/go-funk v0.9.3 + golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 google.golang.org/grpc v1.54.0 google.golang.org/protobuf v1.28.1 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/andybalholm/brotli v1.0.4 // indirect + github.com/apache/thrift v0.16.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/goccy/go-json v0.9.11 // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/flatbuffers v2.0.8+incompatible // indirect + github.com/klauspost/asmfmt v1.3.2 // indirect + github.com/klauspost/compress v1.15.9 // indirect + github.com/klauspost/cpuid/v2 v2.0.9 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect + github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect + github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect + github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect + github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect + github.com/rivo/uniseg v0.2.0 // indirect + github.com/zeebo/xxh3 v1.0.2 // indirect + golang.org/x/mod v0.8.0 // indirect golang.org/x/net v0.8.0 // indirect golang.org/x/sys v0.6.0 // indirect + golang.org/x/term v0.6.0 // indirect golang.org/x/text v0.8.0 // indirect + golang.org/x/tools v0.6.0 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index dd3efc18..6ea97af4 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,118 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/apache/arrow/go/v13 v13.0.0-20230601214540-018e7d3f9c4b h1:b+Df4ZiU6TTTBq8KSVKYcr/Jr9xqek4D4EySaHyvzdA= +github.com/apache/arrow/go/v13 v13.0.0-20230601214540-018e7d3f9c4b/go.mod h1:/XatdE3kDIBqZKhZ7OBUHwP2jaASDFZHqF4puOWM8po= +github.com/apache/thrift v0.16.0 h1:qEy6UW60iVOlUy+b9ZR0d5WzUWYGOo4HfopoyBaNmoY= +github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/avast/retry-go/v4 v4.3.4 h1:pHLkL7jvCvP317I8Ge+Km2Yhntv3SdkJm7uekkqbKhM= +github.com/avast/retry-go/v4 v4.3.4/go.mod h1:rv+Nla6Vk3/ilU0H51VHddWHiwimzX66yZ0JT6T+UvE= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= +github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM= +github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= 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= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw= +github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= +github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpspGNG7Z948v4n35fFGB3RR3G/ry4FWs= +github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI= +github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= +github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= +github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= +github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= +github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/schollz/progressbar/v3 v3.13.1 h1:o8rySDYiQ59Mwzy2FELeHY5ZARXZTVJC7iHD6PEFUiE= +github.com/schollz/progressbar/v3 v3.13.1/go.mod h1:xvrbki8kfT1fzWzBT/UZd9L6GA+jdL7HAgq2RFnO6fQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/thoas/go-funk v0.9.3 h1:7+nAEx3kn5ZJcnDm2Bh23N2yOtweO14bi//dvRtgLpw= github.com/thoas/go-funk v0.9.3/go.mod h1:+IWnUfUmFO1+WVYQWQtIJHeRRdaIyyYglZN7xzUPe4Q= +github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= +github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0= +github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f h1:BWUVssLB0HVOSY78gIdvk1dTVYtT1y8SBWtPYuTJ/6w= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= @@ -32,10 +121,11 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/managedplugin/download.go b/managedplugin/download.go new file mode 100644 index 00000000..4c90f82e --- /dev/null +++ b/managedplugin/download.go @@ -0,0 +1,220 @@ +package managedplugin + +import ( + "archive/zip" + "context" + "errors" + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "runtime" + "strings" + "time" + + "github.com/avast/retry-go/v4" + "github.com/schollz/progressbar/v3" +) + +const ( + DefaultDownloadDir = ".cq" + RetryAttempts = 5 + RetryWaitTime = 1 * time.Second +) + +// getURLLocation return the URL of the plugin +// this does a few HEAD requests because we had a few breaking changes to where +// we store the plugins on GitHub +// TODO: we can improve this by just embedding all plugins and last version that exist in different places then +// the latest +func getURLLocation(ctx context.Context, org string, name string, version string) (string, error) { + urls := []string{ + fmt.Sprintf("https://github.com/%s/cq-plugin-%s/releases/download/%s/cq-plugin-%s_%s_%s.zip", org, name, version, name, runtime.GOOS, runtime.GOARCH), + fmt.Sprintf("https://github.com/%s/cq-source-%s/releases/download/%s/cq-source-%s_%s_%s.zip", org, name, version, name, runtime.GOOS, runtime.GOARCH), + fmt.Sprintf("https://github.com/%s/cq-destination-%s/releases/download/%s/cq-destination-%s_%s_%s.zip", org, name, version, name, runtime.GOOS, runtime.GOARCH), + } + if org == "cloudquery" { + urls = append(urls, fmt.Sprintf("https://github.com/cloudquery/cloudquery/releases/download/plugins-plugin-%s-%s/%s_%s_%s.zip", name, version, name, runtime.GOOS, runtime.GOARCH)) + urls = append(urls, fmt.Sprintf("https://github.com/cloudquery/cloudquery/releases/download/plugins-source-%s-%s/%s_%s_%s.zip", name, version, name, runtime.GOOS, runtime.GOARCH)) + urls = append(urls, fmt.Sprintf("https://github.com/cloudquery/cloudquery/releases/download/plugins-destination-%s-%s/%s_%s_%s.zip", name, version, name, runtime.GOOS, runtime.GOARCH)) + } + + for _, url := range urls { + req, err := http.NewRequestWithContext(ctx, http.MethodHead, url, nil) + if err != nil { + return "", fmt.Errorf("failed create request %s: %w", url, err) + } + resp, err := http.DefaultClient.Do(req) + if err != nil { + return "", fmt.Errorf("failed to get url %s: %w", url, err) + } + defer resp.Body.Close() + // Check server response + if resp.StatusCode == http.StatusNotFound { + continue + } else if resp.StatusCode != http.StatusOK { + fmt.Printf("Failed downloading %s with status code %d. Retrying\n", url, resp.StatusCode) + return "", errors.New("statusCode != 200") + } + return url, nil + } + + return "", fmt.Errorf("failed to find plugin %s/%s version %s", org, name, version) +} + +func DownloadPluginFromGithub(ctx context.Context, localPath string, org string, name string, version string) error { + downloadDir := filepath.Dir(localPath) + pluginZipPath := localPath + ".zip" + + if _, err := os.Stat(localPath); err == nil { + return nil + } + + if err := os.MkdirAll(downloadDir, 0755); err != nil { + return fmt.Errorf("failed to create plugin directory %s: %w", downloadDir, err) + } + + url, err := getURLLocation(ctx, org, name, version) + if err != nil { + return fmt.Errorf("failed to get plugin url: %w", err) + } + if err := downloadFile(ctx, pluginZipPath, url); err != nil { + return fmt.Errorf("failed to download plugin: %w", err) + } + + archive, err := zip.OpenReader(pluginZipPath) + if err != nil { + return fmt.Errorf("failed to open plugin archive: %w", err) + } + defer archive.Close() + + var pathInArchive string + switch { + case strings.HasPrefix(url, "https://github.com/cloudquery/cloudquery/releases/download/plugins-plugin"): + pathInArchive = fmt.Sprintf("plugins/plugin/%s", name) + case strings.HasPrefix(url, "https://github.com/cloudquery/cloudquery/releases/download/plugins-source"): + pathInArchive = fmt.Sprintf("plugins/source/%s", name) + case strings.HasPrefix(url, "https://github.com/cloudquery/cloudquery/releases/download/plugins-destination"): + pathInArchive = fmt.Sprintf("plugins/destination/%s", name) + case strings.HasPrefix(url, fmt.Sprintf("https://github.com/%s/cq-plugin", org)): + pathInArchive = fmt.Sprintf("cq-plugin-%s", name) + case strings.HasPrefix(url, fmt.Sprintf("https://github.com/%s/cq-source", org)): + pathInArchive = fmt.Sprintf("cq-source-%s", name) + case strings.HasPrefix(url, fmt.Sprintf("https://github.com/%s/cq-destination", org)): + pathInArchive = fmt.Sprintf("cq-destination-%s", name) + default: + return fmt.Errorf("unknown GitHub %s", url) + } + + pathInArchive = WithBinarySuffix(pathInArchive) + fileInArchive, err := archive.Open(pathInArchive) + if err != nil { + return fmt.Errorf("failed to open plugin archive plugins/source/%s: %w", name, err) + } + out, err := os.OpenFile(localPath, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0744) + if err != nil { + return fmt.Errorf("failed to create file %s: %w", localPath, err) + } + _, err = io.Copy(out, fileInArchive) + if err != nil { + return fmt.Errorf("failed to copy body to file: %w", err) + } + err = out.Close() + if err != nil { + return fmt.Errorf("failed to close file: %w", err) + } + return nil +} + +func downloadFile(ctx context.Context, localPath string, url string) error { + // Create the file + out, err := os.Create(localPath) + if err != nil { + return fmt.Errorf("failed to create file %s: %w", localPath, err) + } + defer out.Close() + + err = downloadFileFromURL(ctx, out, url) + if err != nil { + return err + } + return nil +} + +func downloadFileFromURL(ctx context.Context, out *os.File, url string) error { + err := retry.Do(func() error { + // Get the data + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) + if err != nil { + return fmt.Errorf("failed create request %s: %w", url, err) + } + + // Do http request + resp, err := http.DefaultClient.Do(req) + if err != nil { + return fmt.Errorf("failed to get url %s: %w", url, err) + } + defer resp.Body.Close() + // Check server response + if resp.StatusCode == http.StatusNotFound { + return errors.New("not found") + } else if resp.StatusCode != http.StatusOK { + fmt.Printf("Failed downloading %s with status code %d. Retrying\n", url, resp.StatusCode) + return errors.New("statusCode != 200") + } + + fmt.Printf("Downloading %s\n", url) + bar := downloadProgressBar(resp.ContentLength, "Downloading") + + // Writer the body to file + _, err = io.Copy(io.MultiWriter(out, bar), resp.Body) + if err != nil { + return fmt.Errorf("failed to copy body to file %s: %w", out.Name(), err) + } + return nil + }, retry.RetryIf(func(err error) bool { + return err.Error() == "statusCode != 200" + }), + retry.Attempts(RetryAttempts), + retry.Delay(RetryWaitTime), + ) + if err != nil { + for _, e := range err.(retry.Error) { + if e.Error() == "not found" { + return e + } + } + return fmt.Errorf("failed downloading URL %q. Error %w", url, err) + } + return nil +} + +func downloadProgressBar(maxBytes int64, description ...string) *progressbar.ProgressBar { + desc := "" + if len(description) > 0 { + desc = description[0] + } + return progressbar.NewOptions64( + maxBytes, + progressbar.OptionSetDescription(desc), + progressbar.OptionSetWriter(os.Stdout), + progressbar.OptionShowBytes(true), + progressbar.OptionSetWidth(10), + progressbar.OptionThrottle(65*time.Millisecond), + progressbar.OptionShowCount(), + progressbar.OptionOnCompletion(func() { + fmt.Fprint(os.Stdout, "\n") + }), + progressbar.OptionSpinnerType(14), + progressbar.OptionFullWidth(), + progressbar.OptionSetRenderBlankState(true), + ) +} + +func WithBinarySuffix(filePath string) string { + if runtime.GOOS == "windows" { + return filePath + ".exe" + } + return filePath +} diff --git a/managedplugin/download_test.go b/managedplugin/download_test.go new file mode 100644 index 00000000..0457e8ce --- /dev/null +++ b/managedplugin/download_test.go @@ -0,0 +1,34 @@ +package managedplugin + +import ( + "context" + "path" + "testing" +) + +func TestDownloadPluginFromGithubIntegration(t *testing.T) { + tmp := t.TempDir() + cases := []struct { + name string + org string + plugin string + version string + wantErr bool + }{ + {name: "monorepo source", org: "cloudquery", plugin: "hackernews", version: "v1.1.4"}, + {name: "many repo source", org: "cloudquery", plugin: "simple-analytics", version: "v1.0.0"}, + {name: "monorepo destination", org: "cloudquery", plugin: "postgresql", version: "v2.0.7"}, + {name: "community source", org: "hermanschaaf", plugin: "simple-analytics", version: "v1.0.0"}, + {name: "invalid community source", org: "cloudquery", plugin: "invalid-plugin", version: "v0.0.x", wantErr: true}, + {name: "invalid monorepo source", org: "not-cloudquery", plugin: "invalid-plugin", version: "v0.0.x", wantErr: true}, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + err := DownloadPluginFromGithub(context.Background(), path.Join(tmp, tc.name), tc.org, tc.plugin, tc.version) + if (err != nil) != tc.wantErr { + t.Errorf("DownloadPluginFromGithub() error = %v, wantErr %v", err, tc.wantErr) + return + } + }) + } +} diff --git a/managedplugin/log_reader.go b/managedplugin/log_reader.go new file mode 100644 index 00000000..2ed7e849 --- /dev/null +++ b/managedplugin/log_reader.go @@ -0,0 +1,59 @@ +package managedplugin + +import ( + "bufio" + "errors" + "io" +) + +// logReaderPrefixLen is used when returning a partial line as context in NextLine +const logReaderPrefixLen = 1000 + +var ( + ErrLogLineToLong = errors.New("log line too long, discarding") + ellipsis = []byte("...") +) + +// logReader is a custom implementation similar to bufio.Scanner, but provides a way to handle lines +// (or tokens) that exceed the buffer size. +type LogReader struct { + bufferedReader *bufio.Reader + reader io.ReadCloser // reader provided by the client +} + +// newLogReader creates a new logReader to read log lines from an io.ReadCloser +func NewLogReader(reader io.ReadCloser) *LogReader { + return &LogReader{ + reader: reader, + bufferedReader: bufio.NewReader(reader), + } +} + +// NextLine reads and returns the next log line from the reader. An io.EOF error is returned +// if the end of the stream has been reached. This implementation is different from bufio.Scanner as it +// also returns an error if a line is too long to fit into the buffer. In this case, an error is returned +// together with a limited prefix of the line. +func (r *LogReader) NextLine() ([]byte, error) { + line, isPrefix, err := r.bufferedReader.ReadLine() + if !isPrefix || err != nil { + return line, err + } + prefix := make([]byte, logReaderPrefixLen) + for i := 0; isPrefix; i++ { + // this loop is entered if a log line is too long to fit into the buffer. We discard it by + // iterating until isPrefix becomes false. We only log the first few bytes of the line to help with + // identification. + if i == 0 { + prefixLen := logReaderPrefixLen + if len(line) < prefixLen { + prefixLen = len(line) + } + copy(prefix, line[:prefixLen]) + } + line, isPrefix, err = r.bufferedReader.ReadLine() + if err != nil { + return nil, err + } + } + return append(prefix, ellipsis...), ErrLogLineToLong +} diff --git a/managedplugin/log_reader_test.go b/managedplugin/log_reader_test.go new file mode 100644 index 00000000..8c23ad72 --- /dev/null +++ b/managedplugin/log_reader_test.go @@ -0,0 +1,115 @@ +package managedplugin + +import ( + "bufio" + "io" + "strings" + "testing" + + "github.com/google/go-cmp/cmp" +) + +func longStr(len int) string { + b := make([]byte, len) + for i := 0; i < len; i++ { + b[i] = byte(65 + (i % 26)) // cycle through letters A to Z + } + return string(b) +} + +func genLogs(num, lineLen int) string { + s := make([]string, num) + for i := 0; i < num; i++ { + s[i] = longStr(lineLen) + } + return strings.Join(s, "\n") +} + +func Test_LogReader(t *testing.T) { + cases := []struct { + name string + text string + wantLines []string + wantErr bool + }{ + { + name: "basic case", + text: `{"k": "v"} +{"k2": "v2"}`, + wantErr: false, + wantLines: []string{ + `{"k": "v"}`, + `{"k2": "v2"}`, + }}, + { + name: "very long line", + text: longStr(10000000), + wantLines: []string{ + longStr(logReaderPrefixLen) + "...", + }, + wantErr: true, + }, + } + for _, tc := range cases { + t.Run(tc.name, func(t *testing.T) { + r := io.NopCloser(strings.NewReader(tc.text)) + lr := NewLogReader(r) + var gotErr error + gotLines := make([]string, 0) + for i := 0; i < len(tc.wantLines)+1; i++ { + line, err := lr.NextLine() + if err == io.EOF { + break + } else if err != nil { + gotErr = err + } + gotLines = append(gotLines, string(line)) + } + if gotErr == nil && tc.wantErr { + t.Fatal("NextLine() was expected to return error, but didn't") + } + if len(gotLines) != len(tc.wantLines) { + t.Fatalf("NextLine() calls got %d lines, want %d", len(gotLines), len(tc.wantLines)) + } + if diff := cmp.Diff(gotLines, tc.wantLines); diff != "" { + t.Errorf("NextLine() lines differ from expected. Diff (-got, +want): %s", diff) + } + }) + } +} + +// we store these package-level variables so that the compiler cannot eliminate the Benchmarks themselves +var ( + bufScannerResult []byte + logReaderResult []byte +) + +func Benchmark_BufferedScanner(b *testing.B) { + logs := genLogs(10, 10000) + bs := bufio.NewScanner(io.NopCloser(strings.NewReader(logs))) + b.ResetTimer() + var got []byte + for n := 0; n < b.N; n++ { + for bs.Scan() { + got = bs.Bytes() + } + } + bufScannerResult = got +} + +func Benchmark_LogReader(b *testing.B) { + logs := genLogs(10, 10000) + lr := NewLogReader(io.NopCloser(strings.NewReader(logs))) + b.ResetTimer() + var got []byte + for n := 0; n < b.N; n++ { + for { + line, err := lr.NextLine() + if err == io.EOF { + break + } + got = line + } + } + logReaderResult = got +} diff --git a/managedplugin/logging.go b/managedplugin/logging.go new file mode 100644 index 00000000..7ec6b4d5 --- /dev/null +++ b/managedplugin/logging.go @@ -0,0 +1,22 @@ +package managedplugin + +import "github.com/rs/zerolog" + +func JSONToLog(l zerolog.Logger, msg map[string]any) { + level := msg["level"] + delete(msg, "level") + switch level { + case "trace": + l.Trace().Fields(msg).Msg("") + case "debug": + l.Debug().Fields(msg).Msg("") + case "info": + l.Info().Fields(msg).Msg("") + case "warn": + l.Warn().Fields(msg).Msg("") + case "error": + l.Error().Fields(msg).Msg("") + default: + l.Error().Fields(msg).Msg("unknown level") + } +} diff --git a/managedplugin/plugin.go b/managedplugin/plugin.go new file mode 100644 index 00000000..f4f35487 --- /dev/null +++ b/managedplugin/plugin.go @@ -0,0 +1,275 @@ +package managedplugin + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "os" + "os/exec" + "path/filepath" + "strings" + "sync" + + pbBase "github.com/cloudquery/plugin-pb-go/pb/base/v0" + pbDiscovery "github.com/cloudquery/plugin-pb-go/pb/discovery/v0" + pbSource "github.com/cloudquery/plugin-pb-go/pb/source/v0" + "github.com/rs/zerolog" + "golang.org/x/exp/slices" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +const ( + defaultDownloadDir = ".cq" + maxMsgSize = 100 * 1024 * 1024 // 100 MiB +) + +type Clients []*Client + +type Config struct { + Name string + Registry Registry + Path string + Version string +} + +type Client struct { + directory string + cmd *exec.Cmd + logger zerolog.Logger + LocalPath string + grpcSocketName string + wg *sync.WaitGroup + Conn *grpc.ClientConn + config Config + noSentry bool +} + +type Option func(*Client) + +func WithLogger(logger zerolog.Logger) func(*Client) { + return func(c *Client) { + c.logger = logger + } +} + +func WithDirectory(directory string) func(*Client) { + return func(c *Client) { + c.directory = directory + } +} + +func WithNoSentry() func(*Client) { + return func(c *Client) { + c.noSentry = true + } +} + +func NewClients(ctx context.Context, sourceSpecs []Config, opts ...Option) (Clients, error) { + clients := make(Clients, len(sourceSpecs)) + for i, spec := range sourceSpecs { + client, err := NewClient(ctx, spec, opts...) + if err != nil { + return nil, err + } + clients[i] = client + } + return clients, nil +} + +func (c Clients) ClientByName(name string) *Client { + for _, client := range c { + if client.config.Name == name { + return client + } + } + return nil +} + +func (c Clients) Terminate() error { + for _, client := range c { + if err := client.Terminate(); err != nil { + return err + } + } + return nil +} + +// NewClient creates a new plugin client. +// If registrySpec is GitHub then client downloads the plugin, spawns it and creates a gRPC connection. +// If registrySpec is Local then client spawns the plugin and creates a gRPC connection. +// If registrySpec is gRPC then clients creates a new connection +func NewClient(ctx context.Context, config Config, opts ...Option) (*Client, error) { + c := Client{ + directory: defaultDownloadDir, + wg: &sync.WaitGroup{}, + config: config, + } + for _, opt := range opts { + opt(&c) + } + var err error + switch config.Registry { + case RegistryGrpc: + c.Conn, err = grpc.DialContext(ctx, config.Path, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(maxMsgSize), + grpc.MaxCallSendMsgSize(maxMsgSize), + ), + ) + if err != nil { + return nil, fmt.Errorf("failed to dial grpc source plugin at %s: %w", config.Path, err) + } + case RegistryLocal: + if err := c.startLocal(ctx, config.Path); err != nil { + return nil, err + } + case RegistryGithub: + pathSplit := strings.Split(config.Path, "/") + if len(pathSplit) != 2 { + return nil, fmt.Errorf("invalid github plugin path: %s. format should be owner/repo", config.Path) + } + org, name := pathSplit[0], pathSplit[1] + c.LocalPath = filepath.Join(c.directory, "plugins", "plugin", org, name, config.Version, "plugin") + c.LocalPath = WithBinarySuffix(c.LocalPath) + if err := DownloadPluginFromGithub(ctx, c.LocalPath, org, name, config.Version); err != nil { + return nil, err + } + if err := c.startLocal(ctx, c.LocalPath); err != nil { + return nil, err + } + } + + return &c, nil +} + +func (c *Client) startLocal(ctx context.Context, path string) error { + c.grpcSocketName = GenerateRandomUnixSocketName() + // spawn the plugin first and then connect + args := []string{"serve", "--network", "unix", "--address", c.grpcSocketName, + "--log-level", c.logger.GetLevel().String(), "--log-format", "json"} + if c.noSentry { + args = append(args, "--no-sentry") + } + cmd := exec.CommandContext(ctx, path, args...) + reader, err := cmd.StdoutPipe() + if err != nil { + return fmt.Errorf("failed to get stdout pipe: %w", err) + } + cmd.Stderr = os.Stderr + cmd.SysProcAttr = getSysProcAttr() + if err := cmd.Start(); err != nil { + return fmt.Errorf("failed to start destination plugin %s: %w", path, err) + } + + c.cmd = cmd + + c.wg.Add(1) + go func() { + defer c.wg.Done() + lr := NewLogReader(reader) + for { + line, err := lr.NextLine() + if errors.Is(err, io.EOF) { + break + } + if errors.Is(err, ErrLogLineToLong) { + c.logger.Info().Str("line", string(line)).Msg("truncated destination plugin log line") + continue + } + if err != nil { + c.logger.Err(err).Msg("failed to read log line from destination plugin") + break + } + var structuredLogLine map[string]any + if err := json.Unmarshal(line, &structuredLogLine); err != nil { + c.logger.Err(err).Str("line", string(line)).Msg("failed to unmarshal log line from destination plugin") + } else { + JSONToLog(c.logger, structuredLogLine) + } + } + }() + + dialer := func(ctx context.Context, addr string) (net.Conn, error) { + d := &net.Dialer{} + return d.DialContext(ctx, "unix", addr) + } + c.Conn, err = grpc.DialContext(ctx, c.grpcSocketName, + grpc.WithTransportCredentials(insecure.NewCredentials()), + grpc.WithBlock(), + grpc.WithContextDialer(dialer), + grpc.WithDefaultCallOptions( + grpc.MaxCallRecvMsgSize(maxMsgSize), + grpc.MaxCallSendMsgSize(maxMsgSize), + )) + if err != nil { + if err := cmd.Process.Kill(); err != nil { + c.logger.Error().Err(err).Msg("failed to kill plugin process") + } + return err + } + return nil +} + +func (c *Client) MaxVersion(ctx context.Context) (int, error) { + discoveryClient := pbDiscovery.NewDiscoveryClient(c.Conn) + versionsRes, err := discoveryClient.GetVersions(ctx, &pbDiscovery.GetVersions_Request{}) + if err != nil { + // If we get an error here, we assume that the plugin is not a v1 plugin and we try to sync it as a v0 plugin + // this is for backward compatibility where we used incorrect versioning mechanism + oldDiscoveryClient := pbSource.NewSourceClient(c.Conn) + versionRes, err := oldDiscoveryClient.GetProtocolVersion(ctx, &pbBase.GetProtocolVersion_Request{}) + if err != nil { + return -1, err + } + switch versionRes.Version { + case 2: + return 0, nil + case 1: + return -1, nil + default: + return -1, fmt.Errorf("unknown protocol version %d", versionRes.Version) + } + } + if slices.Contains(versionsRes.Versions, "v2") { + return 2, nil + } + if slices.Contains(versionsRes.Versions, "v1") { + return 1, nil + } + if slices.Contains(versionsRes.Versions, "v0") { + return 0, nil + } + return -1, fmt.Errorf("unknown protocol versions %v", versionsRes.Versions) +} + +func (c *Client) Terminate() error { + // wait for log streaming to complete before returning from this function + defer c.wg.Wait() + + if c.grpcSocketName != "" { + defer func() { + if err := os.RemoveAll(c.grpcSocketName); err != nil { + c.logger.Error().Err(err).Msg("failed to remove source socket file") + } + }() + } + + if c.Conn != nil { + if err := c.Conn.Close(); err != nil { + c.logger.Error().Err(err).Msg("failed to close gRPC connection to source plugin") + } + c.Conn = nil + } + if c.cmd != nil && c.cmd.Process != nil { + if err := c.terminateProcess(); err != nil { + return err + } + } + + return nil +} diff --git a/managedplugin/random.go b/managedplugin/random.go new file mode 100644 index 00000000..f842a2dc --- /dev/null +++ b/managedplugin/random.go @@ -0,0 +1,27 @@ +package managedplugin + +import ( + "math/rand" + "os" + "path/filepath" + "time" +) + +var unixSocketDir = os.TempDir() + +// https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go/22892986#22892986 + +var letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") + +func randSeq(n int) string { + b := make([]rune, n) + rand.Seed(time.Now().UnixNano()) + for i := range b { + b[i] = letters[rand.Intn(len(letters))] + } + return string(b) +} + +func GenerateRandomUnixSocketName() string { + return filepath.Join(unixSocketDir, "cq-"+randSeq(16)+".sock") +} diff --git a/managedplugin/registry.go b/managedplugin/registry.go new file mode 100644 index 00000000..60e134f1 --- /dev/null +++ b/managedplugin/registry.go @@ -0,0 +1,49 @@ +package managedplugin + +import ( + "bytes" + "encoding/json" + "fmt" +) + +type Registry int + +const ( + RegistryGithub Registry = iota + RegistryLocal + RegistryGrpc +) + +func (r Registry) String() string { + return [...]string{"github", "local", "grpc"}[r] +} +func (r Registry) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(r.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (r *Registry) UnmarshalJSON(data []byte) (err error) { + var registry string + if err := json.Unmarshal(data, ®istry); err != nil { + return err + } + if *r, err = RegistryFromString(registry); err != nil { + return err + } + return nil +} + +func RegistryFromString(s string) (Registry, error) { + switch s { + case "github": + return RegistryGithub, nil + case "local": + return RegistryLocal, nil + case "grpc": + return RegistryGrpc, nil + default: + return RegistryGithub, fmt.Errorf("unknown registry %s", s) + } +} diff --git a/managedplugin/registry_test.go b/managedplugin/registry_test.go new file mode 100644 index 00000000..198c81a1 --- /dev/null +++ b/managedplugin/registry_test.go @@ -0,0 +1,36 @@ +package managedplugin + +import ( + "encoding/json" + "testing" + + "gopkg.in/yaml.v3" +) + +func TestRegistryJsonMarshalUnmarshal(t *testing.T) { + b, err := json.Marshal(RegistryGrpc) + if err != nil { + t.Fatal("failed to marshal registry:", err) + } + var registry Registry + if err := json.Unmarshal(b, ®istry); err != nil { + t.Fatal("failed to unmarshal registry:", err) + } + if registry != RegistryGrpc { + t.Fatal("expected registry to be github, but got:", registry) + } +} + +func TestRegistryYamlMarshalUnmarsahl(t *testing.T) { + b, err := yaml.Marshal(RegistryGrpc) + if err != nil { + t.Fatal("failed to marshal registry:", err) + } + var registry Registry + if err := yaml.Unmarshal(b, ®istry); err != nil { + t.Fatal("failed to unmarshal registry:", err) + } + if registry != RegistryGrpc { + t.Fatal("expected registry to be github, but got:", registry) + } +} diff --git a/managedplugin/unix.go b/managedplugin/unix.go new file mode 100644 index 00000000..27134624 --- /dev/null +++ b/managedplugin/unix.go @@ -0,0 +1,49 @@ +//go:build !windows + +package managedplugin + +import ( + "fmt" + "os" + "syscall" + "time" +) + +func getSysProcAttr() *syscall.SysProcAttr { + return &syscall.SysProcAttr{ + // launch as new process group so that signals (ex: SIGINT) are not sent to the child process + Setpgid: true, // UNIX systems + } +} + +func (c *Client) terminateProcess() error { + c.logger.Debug().Msg("sending interrupt signal to source plugin") + if err := c.cmd.Process.Signal(os.Interrupt); err != nil { + c.logger.Error().Err(err).Msg("failed to send interrupt signal to source plugin") + } + timer := time.AfterFunc(5*time.Second, func() { + c.logger.Info().Msg("sending kill signal to source plugin") + if err := c.cmd.Process.Kill(); err != nil { + c.logger.Error().Err(err).Msg("failed to kill source plugin") + } + }) + c.logger.Info().Msg("waiting for source plugin to terminate") + st, err := c.cmd.Process.Wait() + timer.Stop() + if err != nil { + return err + } + if !st.Success() { + var additionalInfo string + status := st.Sys().(syscall.WaitStatus) + if status.Signaled() && st.ExitCode() != -1 { + additionalInfo += fmt.Sprintf(" (exit code: %d)", st.ExitCode()) + } + if st.ExitCode() == 137 { + additionalInfo = " (Out of Memory)" + } + return fmt.Errorf("source plugin process failed with %s%s", st.String(), additionalInfo) + } + + return nil +} diff --git a/managedplugin/windows.go b/managedplugin/windows.go new file mode 100644 index 00000000..47ecc80d --- /dev/null +++ b/managedplugin/windows.go @@ -0,0 +1,33 @@ +//go:build windows + +package managedplugin + +import ( + "syscall" +) + +func getSysProcAttr() *syscall.SysProcAttr { + return &syscall.SysProcAttr{ + // launch as new process group so that signals are not sent to the child process + CreationFlags: syscall.CREATE_NEW_PROCESS_GROUP, // windows + } +} + +func (c *Client) terminateProcess() error { + c.logger.Debug().Msg("sending kill signal to destination plugin") + if err := c.cmd.Process.Kill(); err != nil { + c.logger.Error().Err(err).Msg("failed to kill source plugin") + } + c.logger.Info().Msg("waiting for source plugin to terminate") + st, err := c.cmd.Process.Wait() + if err != nil { + return err + } + if !st.Success() { + // on windows there is no way to shutdown gracefully via signal. Maybe we can do it via grpc api? + // though it is a bit strange to expose api to shutdown a server :thinking?: + c.logger.Info().Msgf("source plugin process exited with %s", st.String()) + } + + return nil +} diff --git a/metrics/metrics.go b/metrics/metrics.go index 5ab8fc23..111f8a49 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -110,4 +110,4 @@ func (s *Metrics) TotalResourcesAtomic() uint64 { } } return total -} \ No newline at end of file +} diff --git a/pb/discovery/v1/discovery.pb.go b/pb/discovery/v1/discovery.pb.go new file mode 100644 index 00000000..c45c07d0 --- /dev/null +++ b/pb/discovery/v1/discovery.pb.go @@ -0,0 +1,261 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: plugin-pb/discovery/v1/discovery.proto + +package discovery + +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 GetVersions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetVersions) Reset() { + *x = GetVersions{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_discovery_v1_discovery_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersions) ProtoMessage() {} + +func (x *GetVersions) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_discovery_v1_discovery_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 GetVersions.ProtoReflect.Descriptor instead. +func (*GetVersions) Descriptor() ([]byte, []int) { + return file_plugin_pb_discovery_v1_discovery_proto_rawDescGZIP(), []int{0} +} + +type GetVersions_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetVersions_Request) Reset() { + *x = GetVersions_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_discovery_v1_discovery_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersions_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersions_Request) ProtoMessage() {} + +func (x *GetVersions_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_discovery_v1_discovery_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 GetVersions_Request.ProtoReflect.Descriptor instead. +func (*GetVersions_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_discovery_v1_discovery_proto_rawDescGZIP(), []int{0, 0} +} + +type GetVersions_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Versions []uint64 `protobuf:"varint,1,rep,packed,name=versions,proto3" json:"versions,omitempty"` +} + +func (x *GetVersions_Response) Reset() { + *x = GetVersions_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_discovery_v1_discovery_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersions_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersions_Response) ProtoMessage() {} + +func (x *GetVersions_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_discovery_v1_discovery_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 GetVersions_Response.ProtoReflect.Descriptor instead. +func (*GetVersions_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_discovery_v1_discovery_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *GetVersions_Response) GetVersions() []uint64 { + if x != nil { + return x.Versions + } + return nil +} + +var File_plugin_pb_discovery_v1_discovery_proto protoreflect.FileDescriptor + +var file_plugin_pb_discovery_v1_discovery_proto_rawDesc = []byte{ + 0x0a, 0x26, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, + 0x31, 0x22, 0x40, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x32, 0x77, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x12, 0x6a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x2c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3e, 0x5a, 0x3c, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, + 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, + 0x76, 0x31, 0x3b, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_plugin_pb_discovery_v1_discovery_proto_rawDescOnce sync.Once + file_plugin_pb_discovery_v1_discovery_proto_rawDescData = file_plugin_pb_discovery_v1_discovery_proto_rawDesc +) + +func file_plugin_pb_discovery_v1_discovery_proto_rawDescGZIP() []byte { + file_plugin_pb_discovery_v1_discovery_proto_rawDescOnce.Do(func() { + file_plugin_pb_discovery_v1_discovery_proto_rawDescData = protoimpl.X.CompressGZIP(file_plugin_pb_discovery_v1_discovery_proto_rawDescData) + }) + return file_plugin_pb_discovery_v1_discovery_proto_rawDescData +} + +var file_plugin_pb_discovery_v1_discovery_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_plugin_pb_discovery_v1_discovery_proto_goTypes = []interface{}{ + (*GetVersions)(nil), // 0: cloudquery.discovery.v1.GetVersions + (*GetVersions_Request)(nil), // 1: cloudquery.discovery.v1.GetVersions.Request + (*GetVersions_Response)(nil), // 2: cloudquery.discovery.v1.GetVersions.Response +} +var file_plugin_pb_discovery_v1_discovery_proto_depIdxs = []int32{ + 1, // 0: cloudquery.discovery.v1.Discovery.GetVersions:input_type -> cloudquery.discovery.v1.GetVersions.Request + 2, // 1: cloudquery.discovery.v1.Discovery.GetVersions:output_type -> cloudquery.discovery.v1.GetVersions.Response + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_plugin_pb_discovery_v1_discovery_proto_init() } +func file_plugin_pb_discovery_v1_discovery_proto_init() { + if File_plugin_pb_discovery_v1_discovery_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_plugin_pb_discovery_v1_discovery_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersions); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_discovery_v1_discovery_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersions_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_discovery_v1_discovery_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersions_Response); 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_plugin_pb_discovery_v1_discovery_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_plugin_pb_discovery_v1_discovery_proto_goTypes, + DependencyIndexes: file_plugin_pb_discovery_v1_discovery_proto_depIdxs, + MessageInfos: file_plugin_pb_discovery_v1_discovery_proto_msgTypes, + }.Build() + File_plugin_pb_discovery_v1_discovery_proto = out.File + file_plugin_pb_discovery_v1_discovery_proto_rawDesc = nil + file_plugin_pb_discovery_v1_discovery_proto_goTypes = nil + file_plugin_pb_discovery_v1_discovery_proto_depIdxs = nil +} diff --git a/pb/discovery/v1/discovery_grpc.pb.go b/pb/discovery/v1/discovery_grpc.pb.go new file mode 100644 index 00000000..ee73dafe --- /dev/null +++ b/pb/discovery/v1/discovery_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.12 +// source: plugin-pb/discovery/v1/discovery.proto + +package discovery + +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 + +// DiscoveryClient is the client API for Discovery 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 DiscoveryClient interface { + // Get the name of the plugin + GetVersions(ctx context.Context, in *GetVersions_Request, opts ...grpc.CallOption) (*GetVersions_Response, error) +} + +type discoveryClient struct { + cc grpc.ClientConnInterface +} + +func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient { + return &discoveryClient{cc} +} + +func (c *discoveryClient) GetVersions(ctx context.Context, in *GetVersions_Request, opts ...grpc.CallOption) (*GetVersions_Response, error) { + out := new(GetVersions_Response) + err := c.cc.Invoke(ctx, "/cloudquery.discovery.v1.Discovery/GetVersions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DiscoveryServer is the server API for Discovery service. +// All implementations must embed UnimplementedDiscoveryServer +// for forward compatibility +type DiscoveryServer interface { + // Get the name of the plugin + GetVersions(context.Context, *GetVersions_Request) (*GetVersions_Response, error) + mustEmbedUnimplementedDiscoveryServer() +} + +// UnimplementedDiscoveryServer must be embedded to have forward compatible implementations. +type UnimplementedDiscoveryServer struct { +} + +func (UnimplementedDiscoveryServer) GetVersions(context.Context, *GetVersions_Request) (*GetVersions_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVersions not implemented") +} +func (UnimplementedDiscoveryServer) mustEmbedUnimplementedDiscoveryServer() {} + +// UnsafeDiscoveryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DiscoveryServer will +// result in compilation errors. +type UnsafeDiscoveryServer interface { + mustEmbedUnimplementedDiscoveryServer() +} + +func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer) { + s.RegisterService(&Discovery_ServiceDesc, srv) +} + +func _Discovery_GetVersions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVersions_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DiscoveryServer).GetVersions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.discovery.v1.Discovery/GetVersions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DiscoveryServer).GetVersions(ctx, req.(*GetVersions_Request)) + } + return interceptor(ctx, in, info, handler) +} + +// Discovery_ServiceDesc is the grpc.ServiceDesc for Discovery service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Discovery_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cloudquery.discovery.v1.Discovery", + HandlerType: (*DiscoveryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetVersions", + Handler: _Discovery_GetVersions_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "plugin-pb/discovery/v1/discovery.proto", +} diff --git a/pb/plugin/v3/plugin.pb.go b/pb/plugin/v3/plugin.pb.go new file mode 100644 index 00000000..bfe1c62a --- /dev/null +++ b/pb/plugin/v3/plugin.pb.go @@ -0,0 +1,2049 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: plugin-pb/plugin/v3/plugin.proto + +package plugin + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + 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 REGISTRY int32 + +const ( + REGISTRY_REGISTRY_GITHUB REGISTRY = 0 + REGISTRY_REGISTRY_GRPC REGISTRY = 1 + REGISTRY_REGISTRY_LOCAL REGISTRY = 2 +) + +// Enum value maps for REGISTRY. +var ( + REGISTRY_name = map[int32]string{ + 0: "REGISTRY_GITHUB", + 1: "REGISTRY_GRPC", + 2: "REGISTRY_LOCAL", + } + REGISTRY_value = map[string]int32{ + "REGISTRY_GITHUB": 0, + "REGISTRY_GRPC": 1, + "REGISTRY_LOCAL": 2, + } +) + +func (x REGISTRY) Enum() *REGISTRY { + p := new(REGISTRY) + *p = x + return p +} + +func (x REGISTRY) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (REGISTRY) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[0].Descriptor() +} + +func (REGISTRY) Type() protoreflect.EnumType { + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[0] +} + +func (x REGISTRY) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use REGISTRY.Descriptor instead. +func (REGISTRY) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{0} +} + +type SCHEDULER int32 + +const ( + SCHEDULER_SCHEDULER_DFS SCHEDULER = 0 + SCHEDULER_SCHEDULER_ROUND_ROBIN SCHEDULER = 1 +) + +// Enum value maps for SCHEDULER. +var ( + SCHEDULER_name = map[int32]string{ + 0: "SCHEDULER_DFS", + 1: "SCHEDULER_ROUND_ROBIN", + } + SCHEDULER_value = map[string]int32{ + "SCHEDULER_DFS": 0, + "SCHEDULER_ROUND_ROBIN": 1, + } +) + +func (x SCHEDULER) Enum() *SCHEDULER { + p := new(SCHEDULER) + *p = x + return p +} + +func (x SCHEDULER) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SCHEDULER) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1].Descriptor() +} + +func (SCHEDULER) Type() protoreflect.EnumType { + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1] +} + +func (x SCHEDULER) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SCHEDULER.Descriptor instead. +func (SCHEDULER) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1} +} + +type Operator int32 + +const ( + Operator_EQUAL Operator = 0 + Operator_LESS_THAN Operator = 1 +) + +// Enum value maps for Operator. +var ( + Operator_name = map[int32]string{ + 0: "EQUAL", + 1: "LESS_THAN", + } + Operator_value = map[string]int32{ + "EQUAL": 0, + "LESS_THAN": 1, + } +) + +func (x Operator) Enum() *Operator { + p := new(Operator) + *p = x + return p +} + +func (x Operator) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Operator) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[2].Descriptor() +} + +func (Operator) Type() protoreflect.EnumType { + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[2] +} + +func (x Operator) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Operator.Descriptor instead. +func (Operator) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{2} +} + +type PK_MODE int32 + +const ( + PK_MODE_DEFAULT PK_MODE = 0 + PK_MODE_CQ_ID_ONLY PK_MODE = 1 +) + +// Enum value maps for PK_MODE. +var ( + PK_MODE_name = map[int32]string{ + 0: "DEFAULT", + 1: "CQ_ID_ONLY", + } + PK_MODE_value = map[string]int32{ + "DEFAULT": 0, + "CQ_ID_ONLY": 1, + } +) + +func (x PK_MODE) Enum() *PK_MODE { + p := new(PK_MODE) + *p = x + return p +} + +func (x PK_MODE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PK_MODE) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[3].Descriptor() +} + +func (PK_MODE) Type() protoreflect.EnumType { + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[3] +} + +func (x PK_MODE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PK_MODE.Descriptor instead. +func (PK_MODE) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{3} +} + +type StateBackendSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` + Registry REGISTRY `protobuf:"varint,4,opt,name=registry,proto3,enum=cloudquery.plugin.v3.REGISTRY" json:"registry,omitempty"` + Spec []byte `protobuf:"bytes,5,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *StateBackendSpec) Reset() { + *x = StateBackendSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StateBackendSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StateBackendSpec) ProtoMessage() {} + +func (x *StateBackendSpec) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 StateBackendSpec.ProtoReflect.Descriptor instead. +func (*StateBackendSpec) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{0} +} + +func (x *StateBackendSpec) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *StateBackendSpec) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *StateBackendSpec) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *StateBackendSpec) GetRegistry() REGISTRY { + if x != nil { + return x.Registry + } + return REGISTRY_REGISTRY_GITHUB +} + +func (x *StateBackendSpec) GetSpec() []byte { + if x != nil { + return x.Spec + } + return nil +} + +type GetName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetName) Reset() { + *x = GetName{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetName) ProtoMessage() {} + +func (x *GetName) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 GetName.ProtoReflect.Descriptor instead. +func (*GetName) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1} +} + +type GetVersion struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetVersion) Reset() { + *x = GetVersion{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersion) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersion) ProtoMessage() {} + +func (x *GetVersion) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 GetVersion.ProtoReflect.Descriptor instead. +func (*GetVersion) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{2} +} + +type Init struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Init) Reset() { + *x = Init{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Init) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Init) ProtoMessage() {} + +func (x *Init) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 Init.ProtoReflect.Descriptor instead. +func (*Init) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{3} +} + +type GetTables struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetTables) Reset() { + *x = GetTables{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTables) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTables) ProtoMessage() {} + +func (x *GetTables) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 GetTables.ProtoReflect.Descriptor instead. +func (*GetTables) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{4} +} + +type MessageCreateTable struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // marshalled arrow.Schema + Table []byte `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"` + MigrateForce bool `protobuf:"varint,2,opt,name=migrate_force,json=migrateForce,proto3" json:"migrate_force,omitempty"` +} + +func (x *MessageCreateTable) Reset() { + *x = MessageCreateTable{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageCreateTable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageCreateTable) ProtoMessage() {} + +func (x *MessageCreateTable) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 MessageCreateTable.ProtoReflect.Descriptor instead. +func (*MessageCreateTable) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{5} +} + +func (x *MessageCreateTable) GetTable() []byte { + if x != nil { + return x.Table + } + return nil +} + +func (x *MessageCreateTable) GetMigrateForce() bool { + if x != nil { + return x.MigrateForce + } + return false +} + +type MessageInsert struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // marshalled arrow.Record + Record []byte `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + Upsert bool `protobuf:"varint,2,opt,name=upsert,proto3" json:"upsert,omitempty"` +} + +func (x *MessageInsert) Reset() { + *x = MessageInsert{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageInsert) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageInsert) ProtoMessage() {} + +func (x *MessageInsert) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 MessageInsert.ProtoReflect.Descriptor instead. +func (*MessageInsert) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{6} +} + +func (x *MessageInsert) GetRecord() []byte { + if x != nil { + return x.Record + } + return nil +} + +func (x *MessageInsert) GetUpsert() bool { + if x != nil { + return x.Upsert + } + return false +} + +type MessageDeleteStale struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // marshalled arrow.Schema + Table []byte `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"` + SourceName string `protobuf:"bytes,2,opt,name=source_name,json=sourceName,proto3" json:"source_name,omitempty"` + SyncTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=sync_time,json=syncTime,proto3" json:"sync_time,omitempty"` +} + +func (x *MessageDeleteStale) Reset() { + *x = MessageDeleteStale{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageDeleteStale) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageDeleteStale) ProtoMessage() {} + +func (x *MessageDeleteStale) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 MessageDeleteStale.ProtoReflect.Descriptor instead. +func (*MessageDeleteStale) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{7} +} + +func (x *MessageDeleteStale) GetTable() []byte { + if x != nil { + return x.Table + } + return nil +} + +func (x *MessageDeleteStale) GetSourceName() string { + if x != nil { + return x.SourceName + } + return "" +} + +func (x *MessageDeleteStale) GetSyncTime() *timestamppb.Timestamp { + if x != nil { + return x.SyncTime + } + return nil +} + +type Sync struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Sync) Reset() { + *x = Sync{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sync) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sync) ProtoMessage() {} + +func (x *Sync) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 Sync.ProtoReflect.Descriptor instead. +func (*Sync) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8} +} + +type Write struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Write) Reset() { + *x = Write{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Write) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Write) ProtoMessage() {} + +func (x *Write) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] + 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 Write.ProtoReflect.Descriptor instead. +func (*Write) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9} +} + +type Close struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Close) Reset() { + *x = Close{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Close) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Close) ProtoMessage() {} + +func (x *Close) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] + 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 Close.ProtoReflect.Descriptor instead. +func (*Close) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10} +} + +type GetName_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetName_Request) Reset() { + *x = GetName_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetName_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetName_Request) ProtoMessage() {} + +func (x *GetName_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] + 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 GetName_Request.ProtoReflect.Descriptor instead. +func (*GetName_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1, 0} +} + +type GetName_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetName_Response) Reset() { + *x = GetName_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetName_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetName_Response) ProtoMessage() {} + +func (x *GetName_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 GetName_Response.ProtoReflect.Descriptor instead. +func (*GetName_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1, 1} +} + +func (x *GetName_Response) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetVersion_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetVersion_Request) Reset() { + *x = GetVersion_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersion_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersion_Request) ProtoMessage() {} + +func (x *GetVersion_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] + 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 GetVersion_Request.ProtoReflect.Descriptor instead. +func (*GetVersion_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{2, 0} +} + +type GetVersion_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *GetVersion_Response) Reset() { + *x = GetVersion_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVersion_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVersion_Response) ProtoMessage() {} + +func (x *GetVersion_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] + 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 GetVersion_Response.ProtoReflect.Descriptor instead. +func (*GetVersion_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *GetVersion_Response) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +type Init_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Spec []byte `protobuf:"bytes,1,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *Init_Request) Reset() { + *x = Init_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Init_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Init_Request) ProtoMessage() {} + +func (x *Init_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] + 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 Init_Request.ProtoReflect.Descriptor instead. +func (*Init_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *Init_Request) GetSpec() []byte { + if x != nil { + return x.Spec + } + return nil +} + +type Init_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Init_Response) Reset() { + *x = Init_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Init_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Init_Response) ProtoMessage() {} + +func (x *Init_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] + 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 Init_Response.ProtoReflect.Descriptor instead. +func (*Init_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{3, 1} +} + +type GetTables_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` + SkipTables []string `protobuf:"bytes,2,rep,name=skip_tables,json=skipTables,proto3" json:"skip_tables,omitempty"` +} + +func (x *GetTables_Request) Reset() { + *x = GetTables_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTables_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTables_Request) ProtoMessage() {} + +func (x *GetTables_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] + 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 GetTables_Request.ProtoReflect.Descriptor instead. +func (*GetTables_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *GetTables_Request) GetTables() []string { + if x != nil { + return x.Tables + } + return nil +} + +func (x *GetTables_Request) GetSkipTables() []string { + if x != nil { + return x.SkipTables + } + return nil +} + +type GetTables_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // marshalled []arrow.Schema + Tables [][]byte `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` +} + +func (x *GetTables_Response) Reset() { + *x = GetTables_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetTables_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetTables_Response) ProtoMessage() {} + +func (x *GetTables_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] + 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 GetTables_Response.ProtoReflect.Descriptor instead. +func (*GetTables_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *GetTables_Response) GetTables() [][]byte { + if x != nil { + return x.Tables + } + return nil +} + +type Sync_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` + SkipTables []string `protobuf:"bytes,2,rep,name=skip_tables,json=skipTables,proto3" json:"skip_tables,omitempty"` + Concurrency int64 `protobuf:"varint,3,opt,name=concurrency,proto3" json:"concurrency,omitempty"` + Scheduler SCHEDULER `protobuf:"varint,4,opt,name=scheduler,proto3,enum=cloudquery.plugin.v3.SCHEDULER" json:"scheduler,omitempty"` + StateBackend *StateBackendSpec `protobuf:"bytes,5,opt,name=state_backend,json=stateBackend,proto3" json:"state_backend,omitempty"` +} + +func (x *Sync_Request) Reset() { + *x = Sync_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sync_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sync_Request) ProtoMessage() {} + +func (x *Sync_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] + 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 Sync_Request.ProtoReflect.Descriptor instead. +func (*Sync_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *Sync_Request) GetTables() []string { + if x != nil { + return x.Tables + } + return nil +} + +func (x *Sync_Request) GetSkipTables() []string { + if x != nil { + return x.SkipTables + } + return nil +} + +func (x *Sync_Request) GetConcurrency() int64 { + if x != nil { + return x.Concurrency + } + return 0 +} + +func (x *Sync_Request) GetScheduler() SCHEDULER { + if x != nil { + return x.Scheduler + } + return SCHEDULER_SCHEDULER_DFS +} + +func (x *Sync_Request) GetStateBackend() *StateBackendSpec { + if x != nil { + return x.StateBackend + } + return nil +} + +type Sync_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Message: + // + // *Sync_Response_CreateTable + // *Sync_Response_Insert + // *Sync_Response_Delete + Message isSync_Response_Message `protobuf_oneof:"message"` +} + +func (x *Sync_Response) Reset() { + *x = Sync_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Sync_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sync_Response) ProtoMessage() {} + +func (x *Sync_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] + 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 Sync_Response.ProtoReflect.Descriptor instead. +func (*Sync_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8, 1} +} + +func (m *Sync_Response) GetMessage() isSync_Response_Message { + if m != nil { + return m.Message + } + return nil +} + +func (x *Sync_Response) GetCreateTable() *MessageCreateTable { + if x, ok := x.GetMessage().(*Sync_Response_CreateTable); ok { + return x.CreateTable + } + return nil +} + +func (x *Sync_Response) GetInsert() *MessageInsert { + if x, ok := x.GetMessage().(*Sync_Response_Insert); ok { + return x.Insert + } + return nil +} + +func (x *Sync_Response) GetDelete() *MessageDeleteStale { + if x, ok := x.GetMessage().(*Sync_Response_Delete); ok { + return x.Delete + } + return nil +} + +type isSync_Response_Message interface { + isSync_Response_Message() +} + +type Sync_Response_CreateTable struct { + CreateTable *MessageCreateTable `protobuf:"bytes,1,opt,name=create_table,json=createTable,proto3,oneof"` +} + +type Sync_Response_Insert struct { + Insert *MessageInsert `protobuf:"bytes,2,opt,name=insert,proto3,oneof"` +} + +type Sync_Response_Delete struct { + Delete *MessageDeleteStale `protobuf:"bytes,3,opt,name=delete,proto3,oneof"` +} + +func (*Sync_Response_CreateTable) isSync_Response_Message() {} + +func (*Sync_Response_Insert) isSync_Response_Message() {} + +func (*Sync_Response_Delete) isSync_Response_Message() {} + +type Write_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Message: + // + // *Write_Request_CreateTable + // *Write_Request_Insert + // *Write_Request_Delete + Message isWrite_Request_Message `protobuf_oneof:"message"` +} + +func (x *Write_Request) Reset() { + *x = Write_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Write_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Write_Request) ProtoMessage() {} + +func (x *Write_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] + 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 Write_Request.ProtoReflect.Descriptor instead. +func (*Write_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 0} +} + +func (m *Write_Request) GetMessage() isWrite_Request_Message { + if m != nil { + return m.Message + } + return nil +} + +func (x *Write_Request) GetCreateTable() *MessageCreateTable { + if x, ok := x.GetMessage().(*Write_Request_CreateTable); ok { + return x.CreateTable + } + return nil +} + +func (x *Write_Request) GetInsert() *MessageInsert { + if x, ok := x.GetMessage().(*Write_Request_Insert); ok { + return x.Insert + } + return nil +} + +func (x *Write_Request) GetDelete() *MessageDeleteStale { + if x, ok := x.GetMessage().(*Write_Request_Delete); ok { + return x.Delete + } + return nil +} + +type isWrite_Request_Message interface { + isWrite_Request_Message() +} + +type Write_Request_CreateTable struct { + CreateTable *MessageCreateTable `protobuf:"bytes,1,opt,name=create_table,json=createTable,proto3,oneof"` +} + +type Write_Request_Insert struct { + Insert *MessageInsert `protobuf:"bytes,2,opt,name=insert,proto3,oneof"` +} + +type Write_Request_Delete struct { + Delete *MessageDeleteStale `protobuf:"bytes,3,opt,name=delete,proto3,oneof"` +} + +func (*Write_Request_CreateTable) isWrite_Request_Message() {} + +func (*Write_Request_Insert) isWrite_Request_Message() {} + +func (*Write_Request_Delete) isWrite_Request_Message() {} + +type Write_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Write_Response) Reset() { + *x = Write_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Write_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Write_Response) ProtoMessage() {} + +func (x *Write_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] + 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 Write_Response.ProtoReflect.Descriptor instead. +func (*Write_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 1} +} + +type Close_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Close_Request) Reset() { + *x = Close_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Close_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Close_Request) ProtoMessage() {} + +func (x *Close_Request) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] + 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 Close_Request.ProtoReflect.Descriptor instead. +func (*Close_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 0} +} + +type Close_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Close_Response) Reset() { + *x = Close_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Close_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Close_Response) ProtoMessage() {} + +func (x *Close_Response) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] + 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 Close_Response.ProtoReflect.Descriptor instead. +func (*Close_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 1} +} + +var File_plugin_pb_plugin_v3_plugin_proto protoreflect.FileDescriptor + +var file_plugin_pb_plugin_v3_plugin_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x14, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa4, 0x01, 0x0a, 0x10, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, + 0x52, 0x59, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x22, 0x34, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x0a, 0x08, 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, 0x22, 0x3d, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x31, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x1a, 0x1d, 0x0a, + 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x1a, 0x0a, 0x0a, 0x08, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x73, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x1a, 0x42, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x1a, 0x22, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x4f, 0x0a, + 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x3f, + 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x73, 0x65, 0x72, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x22, + 0x84, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, + 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x73, 0x79, + 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe3, 0x03, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x1a, + 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, + 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, + 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x62, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, + 0x6e, 0x64, 0x1a, 0xe7, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, + 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, + 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, + 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xfc, 0x01, 0x0a, + 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, 0xe6, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, + 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x46, 0x0a, 0x08, 0x52, + 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, + 0x54, 0x52, 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, + 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, + 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, + 0x4c, 0x10, 0x02, 0x2a, 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, + 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, + 0x53, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, + 0x5f, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x24, + 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, + 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, + 0x41, 0x4e, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, + 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x32, 0xf3, 0x04, 0x0a, + 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x52, + 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, + 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_plugin_pb_plugin_v3_plugin_proto_rawDescOnce sync.Once + file_plugin_pb_plugin_v3_plugin_proto_rawDescData = file_plugin_pb_plugin_v3_plugin_proto_rawDesc +) + +func file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP() []byte { + file_plugin_pb_plugin_v3_plugin_proto_rawDescOnce.Do(func() { + file_plugin_pb_plugin_v3_plugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_plugin_pb_plugin_v3_plugin_proto_rawDescData) + }) + return file_plugin_pb_plugin_v3_plugin_proto_rawDescData +} + +var file_plugin_pb_plugin_v3_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_plugin_pb_plugin_v3_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_plugin_pb_plugin_v3_plugin_proto_goTypes = []interface{}{ + (REGISTRY)(0), // 0: cloudquery.plugin.v3.REGISTRY + (SCHEDULER)(0), // 1: cloudquery.plugin.v3.SCHEDULER + (Operator)(0), // 2: cloudquery.plugin.v3.Operator + (PK_MODE)(0), // 3: cloudquery.plugin.v3.PK_MODE + (*StateBackendSpec)(nil), // 4: cloudquery.plugin.v3.StateBackendSpec + (*GetName)(nil), // 5: cloudquery.plugin.v3.GetName + (*GetVersion)(nil), // 6: cloudquery.plugin.v3.GetVersion + (*Init)(nil), // 7: cloudquery.plugin.v3.Init + (*GetTables)(nil), // 8: cloudquery.plugin.v3.GetTables + (*MessageCreateTable)(nil), // 9: cloudquery.plugin.v3.MessageCreateTable + (*MessageInsert)(nil), // 10: cloudquery.plugin.v3.MessageInsert + (*MessageDeleteStale)(nil), // 11: cloudquery.plugin.v3.MessageDeleteStale + (*Sync)(nil), // 12: cloudquery.plugin.v3.Sync + (*Write)(nil), // 13: cloudquery.plugin.v3.Write + (*Close)(nil), // 14: cloudquery.plugin.v3.Close + (*GetName_Request)(nil), // 15: cloudquery.plugin.v3.GetName.Request + (*GetName_Response)(nil), // 16: cloudquery.plugin.v3.GetName.Response + (*GetVersion_Request)(nil), // 17: cloudquery.plugin.v3.GetVersion.Request + (*GetVersion_Response)(nil), // 18: cloudquery.plugin.v3.GetVersion.Response + (*Init_Request)(nil), // 19: cloudquery.plugin.v3.Init.Request + (*Init_Response)(nil), // 20: cloudquery.plugin.v3.Init.Response + (*GetTables_Request)(nil), // 21: cloudquery.plugin.v3.GetTables.Request + (*GetTables_Response)(nil), // 22: cloudquery.plugin.v3.GetTables.Response + (*Sync_Request)(nil), // 23: cloudquery.plugin.v3.Sync.Request + (*Sync_Response)(nil), // 24: cloudquery.plugin.v3.Sync.Response + (*Write_Request)(nil), // 25: cloudquery.plugin.v3.Write.Request + (*Write_Response)(nil), // 26: cloudquery.plugin.v3.Write.Response + (*Close_Request)(nil), // 27: cloudquery.plugin.v3.Close.Request + (*Close_Response)(nil), // 28: cloudquery.plugin.v3.Close.Response + (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp +} +var file_plugin_pb_plugin_v3_plugin_proto_depIdxs = []int32{ + 0, // 0: cloudquery.plugin.v3.StateBackendSpec.registry:type_name -> cloudquery.plugin.v3.REGISTRY + 29, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp + 1, // 2: cloudquery.plugin.v3.Sync.Request.scheduler:type_name -> cloudquery.plugin.v3.SCHEDULER + 4, // 3: cloudquery.plugin.v3.Sync.Request.state_backend:type_name -> cloudquery.plugin.v3.StateBackendSpec + 9, // 4: cloudquery.plugin.v3.Sync.Response.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 10, // 5: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 11, // 6: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 9, // 7: cloudquery.plugin.v3.Write.Request.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 10, // 8: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 11, // 9: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 15, // 10: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request + 17, // 11: cloudquery.plugin.v3.Plugin.GetVersion:input_type -> cloudquery.plugin.v3.GetVersion.Request + 19, // 12: cloudquery.plugin.v3.Plugin.Init:input_type -> cloudquery.plugin.v3.Init.Request + 21, // 13: cloudquery.plugin.v3.Plugin.GetTables:input_type -> cloudquery.plugin.v3.GetTables.Request + 23, // 14: cloudquery.plugin.v3.Plugin.Sync:input_type -> cloudquery.plugin.v3.Sync.Request + 25, // 15: cloudquery.plugin.v3.Plugin.Write:input_type -> cloudquery.plugin.v3.Write.Request + 27, // 16: cloudquery.plugin.v3.Plugin.Close:input_type -> cloudquery.plugin.v3.Close.Request + 16, // 17: cloudquery.plugin.v3.Plugin.GetName:output_type -> cloudquery.plugin.v3.GetName.Response + 18, // 18: cloudquery.plugin.v3.Plugin.GetVersion:output_type -> cloudquery.plugin.v3.GetVersion.Response + 20, // 19: cloudquery.plugin.v3.Plugin.Init:output_type -> cloudquery.plugin.v3.Init.Response + 22, // 20: cloudquery.plugin.v3.Plugin.GetTables:output_type -> cloudquery.plugin.v3.GetTables.Response + 24, // 21: cloudquery.plugin.v3.Plugin.Sync:output_type -> cloudquery.plugin.v3.Sync.Response + 26, // 22: cloudquery.plugin.v3.Plugin.Write:output_type -> cloudquery.plugin.v3.Write.Response + 28, // 23: cloudquery.plugin.v3.Plugin.Close:output_type -> cloudquery.plugin.v3.Close.Response + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_plugin_pb_plugin_v3_plugin_proto_init() } +func file_plugin_pb_plugin_v3_plugin_proto_init() { + if File_plugin_pb_plugin_v3_plugin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StateBackendSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetName); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersion); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Init); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTables); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageCreateTable); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageInsert); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageDeleteStale); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sync); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Write); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Close); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetName_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetName_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersion_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVersion_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Init_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Init_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTables_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetTables_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sync_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Sync_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Write_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Write_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Close_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Close_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20].OneofWrappers = []interface{}{ + (*Sync_Response_CreateTable)(nil), + (*Sync_Response_Insert)(nil), + (*Sync_Response_Delete)(nil), + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].OneofWrappers = []interface{}{ + (*Write_Request_CreateTable)(nil), + (*Write_Request_Insert)(nil), + (*Write_Request_Delete)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_plugin_pb_plugin_v3_plugin_proto_rawDesc, + NumEnums: 4, + NumMessages: 25, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_plugin_pb_plugin_v3_plugin_proto_goTypes, + DependencyIndexes: file_plugin_pb_plugin_v3_plugin_proto_depIdxs, + EnumInfos: file_plugin_pb_plugin_v3_plugin_proto_enumTypes, + MessageInfos: file_plugin_pb_plugin_v3_plugin_proto_msgTypes, + }.Build() + File_plugin_pb_plugin_v3_plugin_proto = out.File + file_plugin_pb_plugin_v3_plugin_proto_rawDesc = nil + file_plugin_pb_plugin_v3_plugin_proto_goTypes = nil + file_plugin_pb_plugin_v3_plugin_proto_depIdxs = nil +} diff --git a/pb/plugin/v3/plugin_grpc.pb.go b/pb/plugin/v3/plugin_grpc.pb.go new file mode 100644 index 00000000..e098f2c6 --- /dev/null +++ b/pb/plugin/v3/plugin_grpc.pb.go @@ -0,0 +1,397 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.12 +// source: plugin-pb/plugin/v3/plugin.proto + +package plugin + +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 + +// PluginClient is the client API for Plugin 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 PluginClient interface { + // Get the name of the plugin + GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) + // Get the current version of the plugin + GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) + // Configure the plugin with the given credentials and mode + Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) + // Get all tables the source plugin supports. Must be called after Init + GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) + // Start the sync the source plugin + Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Plugin_SyncClient, error) + // Write resources + Write(ctx context.Context, opts ...grpc.CallOption) (Plugin_WriteClient, error) + // Send signal to flush and close open connections + Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) +} + +type pluginClient struct { + cc grpc.ClientConnInterface +} + +func NewPluginClient(cc grpc.ClientConnInterface) PluginClient { + return &pluginClient{cc} +} + +func (c *pluginClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { + out := new(GetName_Response) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { + out := new(GetVersion_Response) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetVersion", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginClient) Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) { + out := new(Init_Response) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Init", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { + out := new(GetTables_Response) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetTables", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *pluginClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Plugin_SyncClient, error) { + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], "/cloudquery.plugin.v3.Plugin/Sync", opts...) + if err != nil { + return nil, err + } + x := &pluginSyncClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Plugin_SyncClient interface { + Recv() (*Sync_Response, error) + grpc.ClientStream +} + +type pluginSyncClient struct { + grpc.ClientStream +} + +func (x *pluginSyncClient) Recv() (*Sync_Response, error) { + m := new(Sync_Response) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *pluginClient) Write(ctx context.Context, opts ...grpc.CallOption) (Plugin_WriteClient, error) { + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[1], "/cloudquery.plugin.v3.Plugin/Write", opts...) + if err != nil { + return nil, err + } + x := &pluginWriteClient{stream} + return x, nil +} + +type Plugin_WriteClient interface { + Send(*Write_Request) error + CloseAndRecv() (*Write_Response, error) + grpc.ClientStream +} + +type pluginWriteClient struct { + grpc.ClientStream +} + +func (x *pluginWriteClient) Send(m *Write_Request) error { + return x.ClientStream.SendMsg(m) +} + +func (x *pluginWriteClient) CloseAndRecv() (*Write_Response, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Write_Response) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *pluginClient) Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) { + out := new(Close_Response) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Close", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PluginServer is the server API for Plugin service. +// All implementations must embed UnimplementedPluginServer +// for forward compatibility +type PluginServer interface { + // Get the name of the plugin + GetName(context.Context, *GetName_Request) (*GetName_Response, error) + // Get the current version of the plugin + GetVersion(context.Context, *GetVersion_Request) (*GetVersion_Response, error) + // Configure the plugin with the given credentials and mode + Init(context.Context, *Init_Request) (*Init_Response, error) + // Get all tables the source plugin supports. Must be called after Init + GetTables(context.Context, *GetTables_Request) (*GetTables_Response, error) + // Start the sync the source plugin + Sync(*Sync_Request, Plugin_SyncServer) error + // Write resources + Write(Plugin_WriteServer) error + // Send signal to flush and close open connections + Close(context.Context, *Close_Request) (*Close_Response, error) + mustEmbedUnimplementedPluginServer() +} + +// UnimplementedPluginServer must be embedded to have forward compatible implementations. +type UnimplementedPluginServer struct { +} + +func (UnimplementedPluginServer) GetName(context.Context, *GetName_Request) (*GetName_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetName not implemented") +} +func (UnimplementedPluginServer) GetVersion(context.Context, *GetVersion_Request) (*GetVersion_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") +} +func (UnimplementedPluginServer) Init(context.Context, *Init_Request) (*Init_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Init not implemented") +} +func (UnimplementedPluginServer) GetTables(context.Context, *GetTables_Request) (*GetTables_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetTables not implemented") +} +func (UnimplementedPluginServer) Sync(*Sync_Request, Plugin_SyncServer) error { + return status.Errorf(codes.Unimplemented, "method Sync not implemented") +} +func (UnimplementedPluginServer) Write(Plugin_WriteServer) error { + return status.Errorf(codes.Unimplemented, "method Write not implemented") +} +func (UnimplementedPluginServer) Close(context.Context, *Close_Request) (*Close_Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method Close not implemented") +} +func (UnimplementedPluginServer) mustEmbedUnimplementedPluginServer() {} + +// UnsafePluginServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PluginServer will +// result in compilation errors. +type UnsafePluginServer interface { + mustEmbedUnimplementedPluginServer() +} + +func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer) { + s.RegisterService(&Plugin_ServiceDesc, srv) +} + +func _Plugin_GetName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetName_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).GetName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).GetName(ctx, req.(*GetName_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Plugin_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVersion_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).GetVersion(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetVersion", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).GetVersion(ctx, req.(*GetVersion_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Plugin_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Init_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).Init(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.plugin.v3.Plugin/Init", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).Init(ctx, req.(*Init_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Plugin_GetTables_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetTables_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).GetTables(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetTables", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).GetTables(ctx, req.(*GetTables_Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Plugin_Sync_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Sync_Request) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(PluginServer).Sync(m, &pluginSyncServer{stream}) +} + +type Plugin_SyncServer interface { + Send(*Sync_Response) error + grpc.ServerStream +} + +type pluginSyncServer struct { + grpc.ServerStream +} + +func (x *pluginSyncServer) Send(m *Sync_Response) error { + return x.ServerStream.SendMsg(m) +} + +func _Plugin_Write_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(PluginServer).Write(&pluginWriteServer{stream}) +} + +type Plugin_WriteServer interface { + SendAndClose(*Write_Response) error + Recv() (*Write_Request, error) + grpc.ServerStream +} + +type pluginWriteServer struct { + grpc.ServerStream +} + +func (x *pluginWriteServer) SendAndClose(m *Write_Response) error { + return x.ServerStream.SendMsg(m) +} + +func (x *pluginWriteServer) Recv() (*Write_Request, error) { + m := new(Write_Request) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Plugin_Close_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Close_Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PluginServer).Close(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cloudquery.plugin.v3.Plugin/Close", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PluginServer).Close(ctx, req.(*Close_Request)) + } + return interceptor(ctx, in, info, handler) +} + +// Plugin_ServiceDesc is the grpc.ServiceDesc for Plugin service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Plugin_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cloudquery.plugin.v3.Plugin", + HandlerType: (*PluginServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetName", + Handler: _Plugin_GetName_Handler, + }, + { + MethodName: "GetVersion", + Handler: _Plugin_GetVersion_Handler, + }, + { + MethodName: "Init", + Handler: _Plugin_Init_Handler, + }, + { + MethodName: "GetTables", + Handler: _Plugin_GetTables_Handler, + }, + { + MethodName: "Close", + Handler: _Plugin_Close_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Sync", + Handler: _Plugin_Sync_Handler, + ServerStreams: true, + }, + { + StreamName: "Write", + Handler: _Plugin_Write_Handler, + ClientStreams: true, + }, + }, + Metadata: "plugin-pb/plugin/v3/plugin.proto", +} diff --git a/pb/specs/v1/spec.pb.go b/pb/specs/v1/spec.pb.go new file mode 100644 index 00000000..a4ccaa92 --- /dev/null +++ b/pb/specs/v1/spec.pb.go @@ -0,0 +1,716 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.21.12 +// source: plugin-pb/specs/v1/spec.proto + +package specs + +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 WRITE_MODE int32 + +const ( + WRITE_MODE_WRITE_MODE_OVERWRITE_DELETE_STALE WRITE_MODE = 0 + WRITE_MODE_WRITE_MODE_OVERWRITE WRITE_MODE = 1 + WRITE_MODE_WRITE_MODE_APPEND WRITE_MODE = 2 +) + +// Enum value maps for WRITE_MODE. +var ( + WRITE_MODE_name = map[int32]string{ + 0: "WRITE_MODE_OVERWRITE_DELETE_STALE", + 1: "WRITE_MODE_OVERWRITE", + 2: "WRITE_MODE_APPEND", + } + WRITE_MODE_value = map[string]int32{ + "WRITE_MODE_OVERWRITE_DELETE_STALE": 0, + "WRITE_MODE_OVERWRITE": 1, + "WRITE_MODE_APPEND": 2, + } +) + +func (x WRITE_MODE) Enum() *WRITE_MODE { + p := new(WRITE_MODE) + *p = x + return p +} + +func (x WRITE_MODE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WRITE_MODE) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_specs_v1_spec_proto_enumTypes[0].Descriptor() +} + +func (WRITE_MODE) Type() protoreflect.EnumType { + return &file_plugin_pb_specs_v1_spec_proto_enumTypes[0] +} + +func (x WRITE_MODE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WRITE_MODE.Descriptor instead. +func (WRITE_MODE) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{0} +} + +type REGISTRY int32 + +const ( + REGISTRY_REGISTRY_GITHUB REGISTRY = 0 + REGISTRY_REGISTRY_GRPC REGISTRY = 1 + REGISTRY_REGISTRY_LOCAL REGISTRY = 2 +) + +// Enum value maps for REGISTRY. +var ( + REGISTRY_name = map[int32]string{ + 0: "REGISTRY_GITHUB", + 1: "REGISTRY_GRPC", + 2: "REGISTRY_LOCAL", + } + REGISTRY_value = map[string]int32{ + "REGISTRY_GITHUB": 0, + "REGISTRY_GRPC": 1, + "REGISTRY_LOCAL": 2, + } +) + +func (x REGISTRY) Enum() *REGISTRY { + p := new(REGISTRY) + *p = x + return p +} + +func (x REGISTRY) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (REGISTRY) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_specs_v1_spec_proto_enumTypes[1].Descriptor() +} + +func (REGISTRY) Type() protoreflect.EnumType { + return &file_plugin_pb_specs_v1_spec_proto_enumTypes[1] +} + +func (x REGISTRY) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use REGISTRY.Descriptor instead. +func (REGISTRY) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{1} +} + +type MIGRATE_MODE int32 + +const ( + MIGRATE_MODE_SAFE MIGRATE_MODE = 0 + MIGRATE_MODE_FORCE MIGRATE_MODE = 1 +) + +// Enum value maps for MIGRATE_MODE. +var ( + MIGRATE_MODE_name = map[int32]string{ + 0: "SAFE", + 1: "FORCE", + } + MIGRATE_MODE_value = map[string]int32{ + "SAFE": 0, + "FORCE": 1, + } +) + +func (x MIGRATE_MODE) Enum() *MIGRATE_MODE { + p := new(MIGRATE_MODE) + *p = x + return p +} + +func (x MIGRATE_MODE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MIGRATE_MODE) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_specs_v1_spec_proto_enumTypes[2].Descriptor() +} + +func (MIGRATE_MODE) Type() protoreflect.EnumType { + return &file_plugin_pb_specs_v1_spec_proto_enumTypes[2] +} + +func (x MIGRATE_MODE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MIGRATE_MODE.Descriptor instead. +func (MIGRATE_MODE) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{2} +} + +type PK_MODE int32 + +const ( + PK_MODE_DEFAULT PK_MODE = 0 + PK_MODE_CQ_ID_ONLY PK_MODE = 1 +) + +// Enum value maps for PK_MODE. +var ( + PK_MODE_name = map[int32]string{ + 0: "DEFAULT", + 1: "CQ_ID_ONLY", + } + PK_MODE_value = map[string]int32{ + "DEFAULT": 0, + "CQ_ID_ONLY": 1, + } +) + +func (x PK_MODE) Enum() *PK_MODE { + p := new(PK_MODE) + *p = x + return p +} + +func (x PK_MODE) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PK_MODE) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_specs_v1_spec_proto_enumTypes[3].Descriptor() +} + +func (PK_MODE) Type() protoreflect.EnumType { + return &file_plugin_pb_specs_v1_spec_proto_enumTypes[3] +} + +func (x PK_MODE) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PK_MODE.Descriptor instead. +func (PK_MODE) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{3} +} + +type SCHEDULER int32 + +const ( + SCHEDULER_SCHEDULER_DFS SCHEDULER = 0 + SCHEDULER_SCHEDULER_ROUND_ROBIN SCHEDULER = 1 +) + +// Enum value maps for SCHEDULER. +var ( + SCHEDULER_name = map[int32]string{ + 0: "SCHEDULER_DFS", + 1: "SCHEDULER_ROUND_ROBIN", + } + SCHEDULER_value = map[string]int32{ + "SCHEDULER_DFS": 0, + "SCHEDULER_ROUND_ROBIN": 1, + } +) + +func (x SCHEDULER) Enum() *SCHEDULER { + p := new(SCHEDULER) + *p = x + return p +} + +func (x SCHEDULER) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SCHEDULER) Descriptor() protoreflect.EnumDescriptor { + return file_plugin_pb_specs_v1_spec_proto_enumTypes[4].Descriptor() +} + +func (SCHEDULER) Type() protoreflect.EnumType { + return &file_plugin_pb_specs_v1_spec_proto_enumTypes[4] +} + +func (x SCHEDULER) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SCHEDULER.Descriptor instead. +func (SCHEDULER) EnumDescriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{4} +} + +type Spec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Registry REGISTRY `protobuf:"varint,2,opt,name=registry,proto3,enum=cloudquery.specs.v1.REGISTRY" json:"registry,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + SyncSpec *SyncSpec `protobuf:"bytes,5,opt,name=sync_spec,json=syncSpec,proto3" json:"sync_spec,omitempty"` + WriteSpec *WriteSpec `protobuf:"bytes,6,opt,name=write_spec,json=writeSpec,proto3" json:"write_spec,omitempty"` + BackendSpec *Spec `protobuf:"bytes,7,opt,name=backend_spec,json=backendSpec,proto3" json:"backend_spec,omitempty"` + Spec []byte `protobuf:"bytes,8,opt,name=spec,proto3" json:"spec,omitempty"` +} + +func (x *Spec) Reset() { + *x = Spec{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Spec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Spec) ProtoMessage() {} + +func (x *Spec) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_specs_v1_spec_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 Spec.ProtoReflect.Descriptor instead. +func (*Spec) Descriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{0} +} + +func (x *Spec) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Spec) GetRegistry() REGISTRY { + if x != nil { + return x.Registry + } + return REGISTRY_REGISTRY_GITHUB +} + +func (x *Spec) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Spec) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Spec) GetSyncSpec() *SyncSpec { + if x != nil { + return x.SyncSpec + } + return nil +} + +func (x *Spec) GetWriteSpec() *WriteSpec { + if x != nil { + return x.WriteSpec + } + return nil +} + +func (x *Spec) GetBackendSpec() *Spec { + if x != nil { + return x.BackendSpec + } + return nil +} + +func (x *Spec) GetSpec() []byte { + if x != nil { + return x.Spec + } + return nil +} + +type WriteSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WriteMode WRITE_MODE `protobuf:"varint,1,opt,name=write_mode,json=writeMode,proto3,enum=cloudquery.specs.v1.WRITE_MODE" json:"write_mode,omitempty"` + MigrateMode MIGRATE_MODE `protobuf:"varint,2,opt,name=migrate_mode,json=migrateMode,proto3,enum=cloudquery.specs.v1.MIGRATE_MODE" json:"migrate_mode,omitempty"` + BatchSize uint64 `protobuf:"varint,3,opt,name=batch_size,json=batchSize,proto3" json:"batch_size,omitempty"` + BatchSizeBytes uint64 `protobuf:"varint,4,opt,name=batch_size_bytes,json=batchSizeBytes,proto3" json:"batch_size_bytes,omitempty"` + PkMode PK_MODE `protobuf:"varint,5,opt,name=pk_mode,json=pkMode,proto3,enum=cloudquery.specs.v1.PK_MODE" json:"pk_mode,omitempty"` +} + +func (x *WriteSpec) Reset() { + *x = WriteSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteSpec) ProtoMessage() {} + +func (x *WriteSpec) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_specs_v1_spec_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 WriteSpec.ProtoReflect.Descriptor instead. +func (*WriteSpec) Descriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{1} +} + +func (x *WriteSpec) GetWriteMode() WRITE_MODE { + if x != nil { + return x.WriteMode + } + return WRITE_MODE_WRITE_MODE_OVERWRITE_DELETE_STALE +} + +func (x *WriteSpec) GetMigrateMode() MIGRATE_MODE { + if x != nil { + return x.MigrateMode + } + return MIGRATE_MODE_SAFE +} + +func (x *WriteSpec) GetBatchSize() uint64 { + if x != nil { + return x.BatchSize + } + return 0 +} + +func (x *WriteSpec) GetBatchSizeBytes() uint64 { + if x != nil { + return x.BatchSizeBytes + } + return 0 +} + +func (x *WriteSpec) GetPkMode() PK_MODE { + if x != nil { + return x.PkMode + } + return PK_MODE_DEFAULT +} + +type SyncSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` + SkipTables []string `protobuf:"bytes,2,rep,name=skip_tables,json=skipTables,proto3" json:"skip_tables,omitempty"` + Destinations []string `protobuf:"bytes,3,rep,name=destinations,proto3" json:"destinations,omitempty"` + Concurrency uint64 `protobuf:"varint,4,opt,name=concurrency,proto3" json:"concurrency,omitempty"` + Scheduler SCHEDULER `protobuf:"varint,5,opt,name=scheduler,proto3,enum=cloudquery.specs.v1.SCHEDULER" json:"scheduler,omitempty"` + DetrministicCqId bool `protobuf:"varint,6,opt,name=detrministic_cq_id,json=detrministicCqId,proto3" json:"detrministic_cq_id,omitempty"` +} + +func (x *SyncSpec) Reset() { + *x = SyncSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncSpec) ProtoMessage() {} + +func (x *SyncSpec) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_specs_v1_spec_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 SyncSpec.ProtoReflect.Descriptor instead. +func (*SyncSpec) Descriptor() ([]byte, []int) { + return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{2} +} + +func (x *SyncSpec) GetTables() []string { + if x != nil { + return x.Tables + } + return nil +} + +func (x *SyncSpec) GetSkipTables() []string { + if x != nil { + return x.SkipTables + } + return nil +} + +func (x *SyncSpec) GetDestinations() []string { + if x != nil { + return x.Destinations + } + return nil +} + +func (x *SyncSpec) GetConcurrency() uint64 { + if x != nil { + return x.Concurrency + } + return 0 +} + +func (x *SyncSpec) GetScheduler() SCHEDULER { + if x != nil { + return x.Scheduler + } + return SCHEDULER_SCHEDULER_DFS +} + +func (x *SyncSpec) GetDetrministicCqId() bool { + if x != nil { + return x.DetrministicCqId + } + return false +} + +var File_plugin_pb_specs_v1_spec_proto protoreflect.FileDescriptor + +var file_plugin_pb_specs_v1_spec_proto_rawDesc = []byte{ + 0x0a, 0x1d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2f, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x2e, 0x76, 0x31, 0x22, 0xd0, 0x02, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, + 0x52, 0x59, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x09, 0x73, 0x79, + 0x6e, 0x63, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x52, 0x08, 0x73, 0x79, + 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3c, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, + 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x91, 0x02, 0x0a, 0x09, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3e, 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, + 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x52, 0x0b, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x42, + 0x79, 0x74, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x70, 0x6b, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x4b, 0x5f, 0x4d, + 0x4f, 0x44, 0x45, 0x52, 0x06, 0x70, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xf5, 0x01, 0x0a, 0x08, + 0x53, 0x79, 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, + 0x65, 0x6e, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, + 0x75, 0x6c, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, + 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x65, 0x74, 0x72, 0x6d, 0x69, 0x6e, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x71, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x10, 0x64, 0x65, 0x74, 0x72, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x69, 0x63, 0x43, + 0x71, 0x49, 0x64, 0x2a, 0x64, 0x0a, 0x0a, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x12, 0x25, 0x0a, 0x21, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, + 0x4f, 0x56, 0x45, 0x52, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, + 0x5f, 0x53, 0x54, 0x41, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x52, 0x49, 0x54, + 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x57, 0x52, 0x49, 0x54, 0x45, + 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, + 0x5f, 0x41, 0x50, 0x50, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, + 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, + 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, + 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, + 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, + 0x02, 0x2a, 0x23, 0x0a, 0x0c, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x46, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, + 0x4f, 0x52, 0x43, 0x45, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, + 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x2a, 0x39, + 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, 0x53, + 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, 0x19, + 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x4e, + 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, + 0x70, 0x62, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x70, 0x65, 0x63, + 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_plugin_pb_specs_v1_spec_proto_rawDescOnce sync.Once + file_plugin_pb_specs_v1_spec_proto_rawDescData = file_plugin_pb_specs_v1_spec_proto_rawDesc +) + +func file_plugin_pb_specs_v1_spec_proto_rawDescGZIP() []byte { + file_plugin_pb_specs_v1_spec_proto_rawDescOnce.Do(func() { + file_plugin_pb_specs_v1_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_plugin_pb_specs_v1_spec_proto_rawDescData) + }) + return file_plugin_pb_specs_v1_spec_proto_rawDescData +} + +var file_plugin_pb_specs_v1_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_plugin_pb_specs_v1_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_plugin_pb_specs_v1_spec_proto_goTypes = []interface{}{ + (WRITE_MODE)(0), // 0: cloudquery.specs.v1.WRITE_MODE + (REGISTRY)(0), // 1: cloudquery.specs.v1.REGISTRY + (MIGRATE_MODE)(0), // 2: cloudquery.specs.v1.MIGRATE_MODE + (PK_MODE)(0), // 3: cloudquery.specs.v1.PK_MODE + (SCHEDULER)(0), // 4: cloudquery.specs.v1.SCHEDULER + (*Spec)(nil), // 5: cloudquery.specs.v1.Spec + (*WriteSpec)(nil), // 6: cloudquery.specs.v1.WriteSpec + (*SyncSpec)(nil), // 7: cloudquery.specs.v1.SyncSpec +} +var file_plugin_pb_specs_v1_spec_proto_depIdxs = []int32{ + 1, // 0: cloudquery.specs.v1.Spec.registry:type_name -> cloudquery.specs.v1.REGISTRY + 7, // 1: cloudquery.specs.v1.Spec.sync_spec:type_name -> cloudquery.specs.v1.SyncSpec + 6, // 2: cloudquery.specs.v1.Spec.write_spec:type_name -> cloudquery.specs.v1.WriteSpec + 5, // 3: cloudquery.specs.v1.Spec.backend_spec:type_name -> cloudquery.specs.v1.Spec + 0, // 4: cloudquery.specs.v1.WriteSpec.write_mode:type_name -> cloudquery.specs.v1.WRITE_MODE + 2, // 5: cloudquery.specs.v1.WriteSpec.migrate_mode:type_name -> cloudquery.specs.v1.MIGRATE_MODE + 3, // 6: cloudquery.specs.v1.WriteSpec.pk_mode:type_name -> cloudquery.specs.v1.PK_MODE + 4, // 7: cloudquery.specs.v1.SyncSpec.scheduler:type_name -> cloudquery.specs.v1.SCHEDULER + 8, // [8:8] is the sub-list for method output_type + 8, // [8:8] is the sub-list for method input_type + 8, // [8:8] is the sub-list for extension type_name + 8, // [8:8] is the sub-list for extension extendee + 0, // [0:8] is the sub-list for field type_name +} + +func init() { file_plugin_pb_specs_v1_spec_proto_init() } +func file_plugin_pb_specs_v1_spec_proto_init() { + if File_plugin_pb_specs_v1_spec_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_plugin_pb_specs_v1_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Spec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_specs_v1_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WriteSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_specs_v1_spec_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncSpec); 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_plugin_pb_specs_v1_spec_proto_rawDesc, + NumEnums: 5, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_plugin_pb_specs_v1_spec_proto_goTypes, + DependencyIndexes: file_plugin_pb_specs_v1_spec_proto_depIdxs, + EnumInfos: file_plugin_pb_specs_v1_spec_proto_enumTypes, + MessageInfos: file_plugin_pb_specs_v1_spec_proto_msgTypes, + }.Build() + File_plugin_pb_specs_v1_spec_proto = out.File + file_plugin_pb_specs_v1_spec_proto_rawDesc = nil + file_plugin_pb_specs_v1_spec_proto_goTypes = nil + file_plugin_pb_specs_v1_spec_proto_depIdxs = nil +} diff --git a/specs/backend.go b/specs/v0/backend.go similarity index 100% rename from specs/backend.go rename to specs/v0/backend.go diff --git a/specs/backend_test.go b/specs/v0/backend_test.go similarity index 100% rename from specs/backend_test.go rename to specs/v0/backend_test.go diff --git a/specs/destination.go b/specs/v0/destination.go similarity index 100% rename from specs/destination.go rename to specs/v0/destination.go diff --git a/specs/destination_test.go b/specs/v0/destination_test.go similarity index 100% rename from specs/destination_test.go rename to specs/v0/destination_test.go diff --git a/specs/doc.go b/specs/v0/doc.go similarity index 100% rename from specs/doc.go rename to specs/v0/doc.go diff --git a/specs/migrate_mode.go b/specs/v0/migrate_mode.go similarity index 100% rename from specs/migrate_mode.go rename to specs/v0/migrate_mode.go diff --git a/specs/migrate_mode_test.go b/specs/v0/migrate_mode_test.go similarity index 100% rename from specs/migrate_mode_test.go rename to specs/v0/migrate_mode_test.go diff --git a/specs/pk_mode.go b/specs/v0/pk_mode.go similarity index 100% rename from specs/pk_mode.go rename to specs/v0/pk_mode.go diff --git a/specs/pk_mode_test.go b/specs/v0/pk_mode_test.go similarity index 100% rename from specs/pk_mode_test.go rename to specs/v0/pk_mode_test.go diff --git a/specs/v0/registry.go b/specs/v0/registry.go new file mode 100644 index 00000000..ddff0388 --- /dev/null +++ b/specs/v0/registry.go @@ -0,0 +1,30 @@ +package specs + +import ( + "fmt" +) + +type Registry int + +const ( + RegistryGithub Registry = iota + RegistryLocal + RegistryGrpc +) + +func (r Registry) String() string { + return [...]string{"github", "local", "grpc"}[r] +} + +func RegistryFromString(s string) (Registry, error) { + switch s { + case "github": + return RegistryGithub, nil + case "local": + return RegistryLocal, nil + case "grpc": + return RegistryGrpc, nil + default: + return RegistryGithub, fmt.Errorf("unknown registry %s", s) + } +} diff --git a/specs/registry_test.go b/specs/v0/registry_test.go similarity index 100% rename from specs/registry_test.go rename to specs/v0/registry_test.go diff --git a/specs/scheduler.go b/specs/v0/scheduler.go similarity index 100% rename from specs/scheduler.go rename to specs/v0/scheduler.go diff --git a/specs/scheduler_test.go b/specs/v0/scheduler_test.go similarity index 100% rename from specs/scheduler_test.go rename to specs/v0/scheduler_test.go diff --git a/specs/source.go b/specs/v0/source.go similarity index 100% rename from specs/source.go rename to specs/v0/source.go diff --git a/specs/source_test.go b/specs/v0/source_test.go similarity index 100% rename from specs/source_test.go rename to specs/v0/source_test.go diff --git a/specs/spec.go b/specs/v0/spec.go similarity index 100% rename from specs/spec.go rename to specs/v0/spec.go diff --git a/specs/spec_reader.go b/specs/v0/spec_reader.go similarity index 100% rename from specs/spec_reader.go rename to specs/v0/spec_reader.go diff --git a/specs/spec_reader_test.go b/specs/v0/spec_reader_test.go similarity index 100% rename from specs/spec_reader_test.go rename to specs/v0/spec_reader_test.go diff --git a/specs/testdata/creds.txt b/specs/v0/testdata/creds.txt similarity index 100% rename from specs/testdata/creds.txt rename to specs/v0/testdata/creds.txt diff --git a/specs/testdata/creds1.txt b/specs/v0/testdata/creds1.txt similarity index 100% rename from specs/testdata/creds1.txt rename to specs/v0/testdata/creds1.txt diff --git a/specs/testdata/dir/aws.yml b/specs/v0/testdata/dir/aws.yml similarity index 100% rename from specs/testdata/dir/aws.yml rename to specs/v0/testdata/dir/aws.yml diff --git a/specs/testdata/dir/postgresql.yml b/specs/v0/testdata/dir/postgresql.yml similarity index 100% rename from specs/testdata/dir/postgresql.yml rename to specs/v0/testdata/dir/postgresql.yml diff --git a/specs/testdata/dir_yaml/aws.yaml b/specs/v0/testdata/dir_yaml/aws.yaml similarity index 100% rename from specs/testdata/dir_yaml/aws.yaml rename to specs/v0/testdata/dir_yaml/aws.yaml diff --git a/specs/testdata/dir_yaml/postgresql.yaml b/specs/v0/testdata/dir_yaml/postgresql.yaml similarity index 100% rename from specs/testdata/dir_yaml/postgresql.yaml rename to specs/v0/testdata/dir_yaml/postgresql.yaml diff --git a/specs/testdata/env_variable_in_string.yml b/specs/v0/testdata/env_variable_in_string.yml similarity index 100% rename from specs/testdata/env_variable_in_string.yml rename to specs/v0/testdata/env_variable_in_string.yml diff --git a/specs/testdata/env_variables.yml b/specs/v0/testdata/env_variables.yml similarity index 100% rename from specs/testdata/env_variables.yml rename to specs/v0/testdata/env_variables.yml diff --git a/specs/testdata/gcp.yml b/specs/v0/testdata/gcp.yml similarity index 100% rename from specs/testdata/gcp.yml rename to specs/v0/testdata/gcp.yml diff --git a/specs/testdata/gcpv2.yml b/specs/v0/testdata/gcpv2.yml similarity index 100% rename from specs/testdata/gcpv2.yml rename to specs/v0/testdata/gcpv2.yml diff --git a/specs/testdata/multiple_sources.yml b/specs/v0/testdata/multiple_sources.yml similarity index 100% rename from specs/testdata/multiple_sources.yml rename to specs/v0/testdata/multiple_sources.yml diff --git a/specs/testdata/number.txt b/specs/v0/testdata/number.txt similarity index 100% rename from specs/testdata/number.txt rename to specs/v0/testdata/number.txt diff --git a/specs/testdata/numbers.yml b/specs/v0/testdata/numbers.yml similarity index 100% rename from specs/testdata/numbers.yml rename to specs/v0/testdata/numbers.yml diff --git a/specs/write_mode.go b/specs/v0/write_mode.go similarity index 100% rename from specs/write_mode.go rename to specs/v0/write_mode.go diff --git a/specs/write_mode_test.go b/specs/v0/write_mode_test.go similarity index 100% rename from specs/write_mode_test.go rename to specs/v0/write_mode_test.go diff --git a/specs/v1/migrate_mode.go b/specs/v1/migrate_mode.go new file mode 100644 index 00000000..f821b0c2 --- /dev/null +++ b/specs/v1/migrate_mode.go @@ -0,0 +1,50 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" +) + +type MigrateMode int + +const ( + MigrateModeSafe MigrateMode = iota + MigrateModeForced +) + +var ( + migrateModeStrings = []string{"safe", "forced"} +) + +func (m MigrateMode) String() string { + return migrateModeStrings[m] +} + +func (m MigrateMode) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(m.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (m *MigrateMode) UnmarshalJSON(data []byte) (err error) { + var migrateMode string + if err := json.Unmarshal(data, &migrateMode); err != nil { + return err + } + if *m, err = MigrateModeFromString(migrateMode); err != nil { + return err + } + return nil +} + +func MigrateModeFromString(s string) (MigrateMode, error) { + switch s { + case "safe": + return MigrateModeSafe, nil + case "forced": + return MigrateModeForced, nil + } + return 0, fmt.Errorf("invalid migrate mode: %s", s) +} diff --git a/specs/v1/migrate_mode_test.go b/specs/v1/migrate_mode_test.go new file mode 100644 index 00000000..34bc2efb --- /dev/null +++ b/specs/v1/migrate_mode_test.go @@ -0,0 +1,33 @@ +package specs + +import ( + "testing" +) + +func TestMigrateModeFromString(t *testing.T) { + var migrateMode MigrateMode + if err := migrateMode.UnmarshalJSON([]byte(`"forced"`)); err != nil { + t.Fatal(err) + } + if migrateMode != MigrateModeForced { + t.Fatalf("expected MigrateModeForced, got %v", migrateMode) + } + if err := migrateMode.UnmarshalJSON([]byte(`"safe"`)); err != nil { + t.Fatal(err) + } + if migrateMode != MigrateModeSafe { + t.Fatalf("expected MigrateModeSafe, got %v", migrateMode) + } +} + +func TestMigrateMode(t *testing.T) { + for _, migrateModeStr := range migrateModeStrings { + migrateMode, err := MigrateModeFromString(migrateModeStr) + if err != nil { + t.Fatal(err) + } + if migrateModeStr != migrateMode.String() { + t.Fatalf("expected:%s got:%s", migrateMode, migrateMode.String()) + } + } +} diff --git a/specs/v1/pk_mode.go b/specs/v1/pk_mode.go new file mode 100644 index 00000000..38c22bb1 --- /dev/null +++ b/specs/v1/pk_mode.go @@ -0,0 +1,50 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" +) + +type PKMode int + +const ( + PKModeDefaultKeys PKMode = iota + PKModeCQID +) + +var ( + pkModeStrings = []string{"default", "cq-id-only"} +) + +func (m PKMode) String() string { + return pkModeStrings[m] +} + +func (m PKMode) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(m.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (m *PKMode) UnmarshalJSON(data []byte) (err error) { + var pkMode string + if err := json.Unmarshal(data, &pkMode); err != nil { + return err + } + if *m, err = PKModeFromString(pkMode); err != nil { + return err + } + return nil +} + +func PKModeFromString(s string) (PKMode, error) { + switch s { + case "default": + return PKModeDefaultKeys, nil + case "cq-id-only": + return PKModeCQID, nil + } + return 0, fmt.Errorf("invalid pk mode: %s", s) +} diff --git a/specs/v1/pk_mode_test.go b/specs/v1/pk_mode_test.go new file mode 100644 index 00000000..198d185e --- /dev/null +++ b/specs/v1/pk_mode_test.go @@ -0,0 +1,49 @@ +package specs + +import ( + "testing" +) + +func TestPKModeFromString(t *testing.T) { + var pkMode PKMode + if err := pkMode.UnmarshalJSON([]byte(`"cq-id-only"`)); err != nil { + t.Fatal(err) + } + if pkMode != PKModeCQID { + t.Fatalf("expected PKModeCQID, got %v", pkMode) + } + if err := pkMode.UnmarshalJSON([]byte(`"default"`)); err != nil { + t.Fatal(err) + } + if pkMode != PKModeDefaultKeys { + t.Fatalf("expected PKModeCompositeKeys, got %v", pkMode) + } +} + +func TestPKMode(t *testing.T) { + for _, pkModeStr := range pkModeStrings { + pkMode, err := PKModeFromString(pkModeStr) + if err != nil { + t.Fatal(err) + } + if pkModeStr != pkMode.String() { + t.Fatalf("expected:%s got:%s", pkModeStr, pkMode.String()) + } + } +} + +func TestPKModeMarshalJSON(t *testing.T) { + pkMode := PKModeCQID + if pkModeStr, err := pkMode.MarshalJSON(); err != nil { + t.Fatal(err) + } else if string(pkModeStr) != `"cq-id-only"` { + t.Fatalf("expected:\"cq-id\" got:%s", string(pkModeStr)) + } + + pkMode = PKModeDefaultKeys + if pkModeStr, err := pkMode.MarshalJSON(); err != nil { + t.Fatal(err) + } else if string(pkModeStr) != `"default"` { + t.Fatalf("expected:\"cq-id\" got:%s", string(pkModeStr)) + } +} diff --git a/specs/v1/plugin.go b/specs/v1/plugin.go new file mode 100644 index 00000000..114f630a --- /dev/null +++ b/specs/v1/plugin.go @@ -0,0 +1,97 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" + "strings" + + "github.com/thoas/go-funk" +) + +// Plugin is the spec for a CloudQuery plugin +type Plugin struct { + // Name of the source plugin to use + Name string `json:"name,omitempty"` + // Version of the source plugin to use + Version string `json:"version,omitempty"` + // Path is the canonical path to the source plugin in a given registry + // For example: + // in github the path will be: org/repo + // For the local registry the path will be the path to the binary: ./path/to/binary + // For the gRPC registry the path will be the address of the gRPC server: host:port + Path string + // Registry can be github,local,grpc. + Registry Registry `json:"registry,omitempty"` + // Sync defines sync behaviour + Sync Sync `json:"sync,omitempty"` + // StateBackend specifies the state backend to use + // for incremental syncs + StateBackend *Plugin `json:"backend,omitempty"` + // Write specifies write behaviour + Write Write `json:"write,omitempty"` + // Spec is defined by each plugin + Spec any `json:"spec,omitempty"` +} + +func (d *Plugin) UnmarshalSpec(out any) error { + b, err := json.Marshal(d.Spec) + if err != nil { + return err + } + dec := json.NewDecoder(bytes.NewReader(b)) + dec.UseNumber() + dec.DisallowUnknownFields() + return dec.Decode(out) +} + +func (d *Plugin) VersionString() string { + if d.Registry != RegistryGithub { + return fmt.Sprintf("%s (%s@%s)", d.Name, d.Registry, d.Path) + } + pathParts := strings.Split(d.Path, "/") + if len(pathParts) != 2 { + return fmt.Sprintf("%s (%s@%s)", d.Name, d.Path, d.Version) + } + if d.Name == pathParts[1] { + return fmt.Sprintf("%s (%s)", d.Name, d.Version) + } + return fmt.Sprintf("%s (%s@%s)", d.Name, pathParts[1], d.Version) +} + +func (d *Plugin) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int) { + if d.Write.BatchSize == 0 { + d.Write.BatchSize = defaultBatchSize + } + if d.Write.BatchSizeBytes == 0 { + d.Write.BatchSizeBytes = defaultBatchSizeBytes + } +} + +func (d *Plugin) Validate() error { + if d.Name == "" { + return fmt.Errorf("name is required") + } + if d.Path == "" { + msg := "path is required" + // give a small hint to help users transition from the old config format that didn't require path + officialPlugins := []string{"postgresql", "csv"} + if funk.ContainsString(officialPlugins, d.Name) { + msg += fmt.Sprintf(". Hint: try setting path to cloudquery/%s in your config", d.Name) + } + return fmt.Errorf(msg) + } + + if d.Registry == RegistryGithub { + if d.Version == "" { + return fmt.Errorf("version is required") + } + if !strings.HasPrefix(d.Version, "v") { + return fmt.Errorf("version must start with v") + } + } + if d.Write.BatchSize < 0 { + return fmt.Errorf("batch_size must be greater than 0") + } + return nil +} diff --git a/specs/v1/plugin_test.go b/specs/v1/plugin_test.go new file mode 100644 index 00000000..19dd1567 --- /dev/null +++ b/specs/v1/plugin_test.go @@ -0,0 +1,270 @@ +package specs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +type testDestinationSpec struct { + ConnectionString string `json:"connection_string"` +} + +func TestPluginSpecUnmarshalSpec(t *testing.T) { + pluginSpec := Plugin{ + Spec: map[string]any{ + "connection_string": "postgres://user:pass@host:port/db", + }, + } + var spec testDestinationSpec + if err := pluginSpec.UnmarshalSpec(&spec); err != nil { + t.Fatal(err) + } + if spec.ConnectionString != "postgres://user:pass@host:port/db" { + t.Fatalf("expected postgres://user:pass@host:port/db, got %s", spec.ConnectionString) + } +} + +var pluginUnmarshalSpecTestCases = []struct { + name string + spec string + err string + source *Sync +}{ + { + "invalid_kind", + `kind: nice`, + "failed to decode spec: unknown kind nice", + nil, + }, + { + "invalid_type", + `kind: plugin +spec: + name: 3 +`, + "failed to decode spec: json: cannot unmarshal number into Go struct field Plugin.name of type string", + &Sync{ + Tables: []string{"*"}, + }, + }, + { + "unknown_field", + `kind: plugin +spec: + namea: 3 +`, + `failed to decode spec: json: unknown field "namea"`, + &Sync{ + Tables: []string{"*"}, + }, + }, +} + +func TestDestinationUnmarshalSpec(t *testing.T) { + for _, tc := range pluginUnmarshalSpecTestCases { + t.Run(tc.name, func(t *testing.T) { + var err error + var spec Spec + err = SpecUnmarshalYamlStrict([]byte(tc.spec), &spec) + if err != nil { + if err.Error() != tc.err { + t.Fatalf("expected:%s got:%s", tc.err, err.Error()) + } + return + } + + source := spec.Spec.(*Sync) + if cmp.Diff(source, tc.source) != "" { + t.Fatalf("expected:%v got:%v", tc.source, source) + } + }) + } +} + +var destinationUnmarshalSpecValidateTestCases = []struct { + name string + spec string + err string + plugin *Plugin +}{ + { + "required_name", + `kind: plugin +spec:`, + "name is required", + nil, + }, + { + "required_version", + `kind: plugin +spec: + name: test + path: cloudquery/test +`, + "version is required", + nil, + }, + { + "required_version_format", + `kind: plugin +spec: + name: test + path: cloudquery/test + version: 1.1.0 +`, + "version must start with v", + nil, + }, + { + "version_is_not_required_for_grpc_registry", + `kind: plugin +spec: + name: test + registry: grpc + path: "localhost:9999" +`, + "", + &Plugin{ + Name: "test", + Registry: RegistryGrpc, + Path: "localhost:9999", + Write: Write{ + BatchSize: 10000, + BatchSizeBytes: 10000000, + }, + }, + }, + { + "version_is_not_required_for_local_registry", + `kind: plugin +spec: + name: test + registry: local + path: "/home/user/some_executable" +`, + "", + &Plugin{ + Name: "test", + Registry: RegistryLocal, + Path: "/home/user/some_executable", + Write: Write{ + BatchSize: 10000, + BatchSizeBytes: 10000000, + }, + }, + }, + { + "success", + `kind: plugin +spec: + name: test + path: cloudquery/test + version: v1.1.0 +`, + "", + &Plugin{ + Name: "test", + Path: "cloudquery/test", + Version: "v1.1.0", + Write: Write{ + BatchSize: 10000, + BatchSizeBytes: 10000000, + }, + }, + }, +} + +func TestDestinationUnmarshalSpecValidate(t *testing.T) { + for _, tc := range destinationUnmarshalSpecValidateTestCases { + t.Run(tc.name, func(t *testing.T) { + var err error + var spec Spec + err = SpecUnmarshalYamlStrict([]byte(tc.spec), &spec) + if err != nil { + t.Fatal(err) + } + p := spec.Spec.(*Plugin) + p.SetDefaults(10000, 10000000) + err = p.Validate() + if err != nil { + if err.Error() != tc.err { + t.Fatalf("expected:\n%s\ngot:\n%s", tc.err, err.Error()) + } + return + } + + if cmp.Diff(p, tc.plugin) != "" { + t.Fatalf("expected:\n%v\ngot:\n%v\n", tc.plugin, p) + } + }) + } +} + +func TestDestination_VersionString(t *testing.T) { + type fields struct { + Name string + Version string + Path string + Registry Registry + } + tests := []struct { + name string + fields fields + want string + }{ + { + name: "should use short version without name part in path when those are the same", + fields: fields{ + Name: "aws", + Version: "v10.0.0", + Path: "cloudquery/aws", + Registry: RegistryGithub, + }, + want: "aws (v10.0.0)", + }, + { + name: "should use long version with path when name doesn't match path", + fields: fields{ + Name: "my-aws-spec", + Version: "v10.0.0", + Path: "cloudquery/aws", + Registry: RegistryGithub, + }, + want: "my-aws-spec (aws@v10.0.0)", + }, + { + name: "should handle non GitHub registry", + fields: fields{ + Name: "my-aws-spec", + Version: "v10.0.0", + Path: "localhost:7777", + Registry: RegistryGrpc, + }, + want: "my-aws-spec (grpc@localhost:7777)", + }, + { + name: "should handle malformed path", + fields: fields{ + Name: "my-aws-spec", + Version: "v10.0.0", + Path: "aws", + Registry: RegistryGithub, + }, + want: "my-aws-spec (aws@v10.0.0)", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + d := Plugin{ + Name: tt.fields.Name, + Version: tt.fields.Version, + Path: tt.fields.Path, + Registry: tt.fields.Registry, + } + if got := d.VersionString(); got != tt.want { + t.Errorf("Destination.String() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/specs/registry.go b/specs/v1/registry.go similarity index 100% rename from specs/registry.go rename to specs/v1/registry.go diff --git a/specs/v1/registry_test.go b/specs/v1/registry_test.go new file mode 100644 index 00000000..d7751a27 --- /dev/null +++ b/specs/v1/registry_test.go @@ -0,0 +1,36 @@ +package specs + +import ( + "encoding/json" + "testing" + + "gopkg.in/yaml.v3" +) + +func TestRegistryJsonMarshalUnmarshal(t *testing.T) { + b, err := json.Marshal(RegistryGrpc) + if err != nil { + t.Fatal("failed to marshal registry:", err) + } + var registry Registry + if err := json.Unmarshal(b, ®istry); err != nil { + t.Fatal("failed to unmarshal registry:", err) + } + if registry != RegistryGrpc { + t.Fatal("expected registry to be github, but got:", registry) + } +} + +func TestRegistryYamlMarshalUnmarsahl(t *testing.T) { + b, err := yaml.Marshal(RegistryGrpc) + if err != nil { + t.Fatal("failed to marshal registry:", err) + } + var registry Registry + if err := yaml.Unmarshal(b, ®istry); err != nil { + t.Fatal("failed to unmarshal registry:", err) + } + if registry != RegistryGrpc { + t.Fatal("expected registry to be github, but got:", registry) + } +} diff --git a/specs/v1/scheduler.go b/specs/v1/scheduler.go new file mode 100644 index 00000000..2f7ddd5d --- /dev/null +++ b/specs/v1/scheduler.go @@ -0,0 +1,60 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" +) + +type Scheduler int + +const ( + SchedulerDFS Scheduler = iota + SchedulerRoundRobin +) + +var AllSchedulers = Schedulers{SchedulerDFS, SchedulerRoundRobin} +var AllSchedulerNames = [...]string{ + SchedulerDFS: "dfs", + SchedulerRoundRobin: "round-robin", +} + +type Schedulers []Scheduler + +func (s Schedulers) String() string { + var buffer bytes.Buffer + for i, scheduler := range s { + if i > 0 { + buffer.WriteString(", ") + } + buffer.WriteString(scheduler.String()) + } + return buffer.String() +} + +func (s Scheduler) String() string { + return AllSchedulerNames[s] +} +func (s Scheduler) MarshalJSON() ([]byte, error) { + return []byte(`"` + s.String() + `"`), nil +} + +func (s *Scheduler) UnmarshalJSON(data []byte) (err error) { + var scheduler string + if err := json.Unmarshal(data, &scheduler); err != nil { + return err + } + if *s, err = SchedulerFromString(scheduler); err != nil { + return err + } + return nil +} + +func SchedulerFromString(s string) (Scheduler, error) { + for i, scheduler := range AllSchedulerNames { + if s == scheduler { + return Scheduler(i), nil + } + } + return SchedulerDFS, fmt.Errorf("unknown scheduler %s", s) +} diff --git a/specs/v1/scheduler_test.go b/specs/v1/scheduler_test.go new file mode 100644 index 00000000..e63f61d4 --- /dev/null +++ b/specs/v1/scheduler_test.go @@ -0,0 +1,36 @@ +package specs + +import ( + "encoding/json" + "testing" + + "gopkg.in/yaml.v3" +) + +func TestSchedulerJsonMarshalUnmarshal(t *testing.T) { + b, err := json.Marshal(SchedulerDFS) + if err != nil { + t.Fatal("failed to marshal scheduler:", err) + } + var scheduler Scheduler + if err := json.Unmarshal(b, &scheduler); err != nil { + t.Fatal("failed to unmarshal scheduler:", err) + } + if scheduler != SchedulerDFS { + t.Fatal("expected scheduler to be dfs, but got:", scheduler) + } +} + +func TestSchedulerYamlMarshalUnmarshal(t *testing.T) { + b, err := yaml.Marshal(SchedulerDFS) + if err != nil { + t.Fatal("failed to marshal scheduler:", err) + } + var scheduler Scheduler + if err := yaml.Unmarshal(b, &scheduler); err != nil { + t.Fatal("failed to unmarshal scheduler:", err) + } + if scheduler != SchedulerDFS { + t.Fatal("expected scheduler to be dfs, but got:", scheduler) + } +} diff --git a/specs/v1/spec.go b/specs/v1/spec.go new file mode 100644 index 00000000..8717dfd2 --- /dev/null +++ b/specs/v1/spec.go @@ -0,0 +1,100 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" + + "github.com/ghodss/yaml" +) + +type Kind int + +type Spec struct { + Kind Kind `json:"kind"` + Spec any `json:"spec"` +} + +const ( + KindPlugin Kind = iota +) + +func (k Kind) String() string { + return [...]string{"plugin"}[k] +} + +func (k Kind) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(k.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (k *Kind) UnmarshalJSON(data []byte) (err error) { + var kind string + if err := json.Unmarshal(data, &kind); err != nil { + return err + } + if *k, err = KindFromString(kind); err != nil { + return err + } + return nil +} + +func KindFromString(s string) (Kind, error) { + switch s { + case "plugin": + return KindPlugin, nil + default: + return KindPlugin, fmt.Errorf("unknown kind %s", s) + } +} + +func (s *Spec) UnmarshalJSON(data []byte) error { + var t struct { + Kind Kind `json:"kind"` + Spec any `json:"spec"` + } + dec := json.NewDecoder(bytes.NewReader(data)) + dec.DisallowUnknownFields() + dec.UseNumber() + if err := dec.Decode(&t); err != nil { + return err + } + s.Kind = t.Kind + switch s.Kind { + case KindPlugin: + s.Spec = new(Plugin) + default: + return fmt.Errorf("unknown kind %s", s.Kind) + } + b, err := json.Marshal(t.Spec) + if err != nil { + return err + } + dec = json.NewDecoder(bytes.NewReader(b)) + dec.UseNumber() + dec.DisallowUnknownFields() + return dec.Decode(s.Spec) +} + +func UnmarshalJSONStrict(b []byte, out any) error { + dec := json.NewDecoder(bytes.NewReader(b)) + dec.DisallowUnknownFields() + dec.UseNumber() + return dec.Decode(out) +} + +func SpecUnmarshalYamlStrict(b []byte, spec *Spec) error { + jb, err := yaml.YAMLToJSON(b) + if err != nil { + return fmt.Errorf("failed to convert yaml to json: %w", err) + } + dec := json.NewDecoder(bytes.NewReader(jb)) + dec.DisallowUnknownFields() + dec.UseNumber() + if err := dec.Decode(spec); err != nil { + return fmt.Errorf("failed to decode spec: %w", err) + } + return nil +} diff --git a/specs/v1/sync.go b/specs/v1/sync.go new file mode 100644 index 00000000..a41ea9c0 --- /dev/null +++ b/specs/v1/sync.go @@ -0,0 +1,18 @@ +package specs + +type Sync struct { + Concurrency uint64 `json:"concurrency,omitempty"` + // Tables to sync from the source plugin + Tables []string `json:"tables,omitempty"` + // SkipTables defines tables to skip when syncing data. Useful if a glob pattern is used in Tables + SkipTables []string `json:"skip_tables,omitempty"` + // SkipDependentTables changes the matching behavior with regard to dependent tables. If set to true, dependent tables will not be synced unless they are explicitly matched by Tables. + SkipDependentTables bool `json:"skip_dependent_tables,omitempty"` + // Destinations are the names of destination plugins to send sync data to + Destinations []string `json:"destinations,omitempty"` + // Scheduler defines the scheduling algorithm that should be used to sync data + Scheduler Scheduler `json:"scheduler,omitempty"` + // DeterministicCQID is a flag that indicates whether the source plugin should generate a random UUID as the value of _cq_id + // or whether it should calculate a UUID that is a hash of the primary keys (if they exist) or the entire resource. + DeterministicCQID bool `json:"deterministic_cq_id,omitempty"` +} diff --git a/specs/v1/write.go b/specs/v1/write.go new file mode 100644 index 00000000..c0ba06f8 --- /dev/null +++ b/specs/v1/write.go @@ -0,0 +1,9 @@ +package specs + +type Write struct { + WriteMode WriteMode `json:"write_mode,omitempty"` + MigrateMode MigrateMode `json:"migrate_mode,omitempty"` + BatchSize int `json:"batch_size,omitempty"` + BatchSizeBytes int `json:"batch_size_bytes,omitempty"` + PKMode PKMode `json:"pk_mode,omitempty"` +} diff --git a/specs/v1/write_mode.go b/specs/v1/write_mode.go new file mode 100644 index 00000000..546e21c8 --- /dev/null +++ b/specs/v1/write_mode.go @@ -0,0 +1,53 @@ +package specs + +import ( + "bytes" + "encoding/json" + "fmt" +) + +type WriteMode int + +const ( + WriteModeOverwriteDeleteStale WriteMode = iota + WriteModeOverwrite + WriteModeAppend +) + +var ( + writeModeStrings = []string{"overwrite-delete-stale", "overwrite", "append"} +) + +func (m WriteMode) String() string { + return writeModeStrings[m] +} + +func (m WriteMode) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(m.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (m *WriteMode) UnmarshalJSON(data []byte) (err error) { + var writeMode string + if err := json.Unmarshal(data, &writeMode); err != nil { + return err + } + if *m, err = WriteModeFromString(writeMode); err != nil { + return err + } + return nil +} + +func WriteModeFromString(s string) (WriteMode, error) { + switch s { + case "append": + return WriteModeAppend, nil + case "overwrite": + return WriteModeOverwrite, nil + case "overwrite-delete-stale": + return WriteModeOverwriteDeleteStale, nil + } + return 0, fmt.Errorf("invalid write mode: %s", s) +} diff --git a/specs/v1/write_mode_test.go b/specs/v1/write_mode_test.go new file mode 100644 index 00000000..289c66c2 --- /dev/null +++ b/specs/v1/write_mode_test.go @@ -0,0 +1,33 @@ +package specs + +import ( + "testing" +) + +func TestWriteModeFromString(t *testing.T) { + var writeMode WriteMode + if err := writeMode.UnmarshalJSON([]byte(`"append"`)); err != nil { + t.Fatal(err) + } + if writeMode != WriteModeAppend { + t.Fatalf("expected WriteModeAppend, got %v", writeMode) + } + if err := writeMode.UnmarshalJSON([]byte(`"overwrite"`)); err != nil { + t.Fatal(err) + } + if writeMode != WriteModeOverwrite { + t.Fatalf("expected WriteModeOverwrite, got %v", writeMode) + } +} + +func TestWriteMode(t *testing.T) { + for _, writeModeStr := range writeModeStrings { + writeMode, err := WriteModeFromString(writeModeStr) + if err != nil { + t.Fatal(err) + } + if writeModeStr != writeMode.String() { + t.Fatalf("expected:%s got:%s", writeModeStr, writeMode.String()) + } + } +} diff --git a/state/client.go b/state/client.go new file mode 100644 index 00000000..7bf2df5b --- /dev/null +++ b/state/client.go @@ -0,0 +1 @@ +package state From db812d230b642d387c3097085b3e9ade6e22c50d Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:35:52 +0300 Subject: [PATCH 2/6] newcommit --- pb/plugin/v3/plugin.pb.go | 571 ++++++++++++++++++++++---------------- 1 file changed, 327 insertions(+), 244 deletions(-) diff --git a/pb/plugin/v3/plugin.pb.go b/pb/plugin/v3/plugin.pb.go index bfe1c62a..5a5fbe28 100644 --- a/pb/plugin/v3/plugin.pb.go +++ b/pb/plugin/v3/plugin.pb.go @@ -439,6 +439,53 @@ func (*GetTables) Descriptor() ([]byte, []int) { return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{4} } +type WriteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MigrateForce bool `protobuf:"varint,1,opt,name=migrate_force,json=migrateForce,proto3" json:"migrate_force,omitempty"` +} + +func (x *WriteOptions) Reset() { + *x = WriteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WriteOptions) ProtoMessage() {} + +func (x *WriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_plugin_pb_plugin_v3_plugin_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 WriteOptions.ProtoReflect.Descriptor instead. +func (*WriteOptions) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{5} +} + +func (x *WriteOptions) GetMigrateForce() bool { + if x != nil { + return x.MigrateForce + } + return false +} + type MessageCreateTable struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -452,7 +499,7 @@ type MessageCreateTable struct { func (x *MessageCreateTable) Reset() { *x = MessageCreateTable{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -465,7 +512,7 @@ func (x *MessageCreateTable) String() string { func (*MessageCreateTable) ProtoMessage() {} func (x *MessageCreateTable) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -478,7 +525,7 @@ func (x *MessageCreateTable) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageCreateTable.ProtoReflect.Descriptor instead. func (*MessageCreateTable) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{5} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{6} } func (x *MessageCreateTable) GetTable() []byte { @@ -508,7 +555,7 @@ type MessageInsert struct { func (x *MessageInsert) Reset() { *x = MessageInsert{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -521,7 +568,7 @@ func (x *MessageInsert) String() string { func (*MessageInsert) ProtoMessage() {} func (x *MessageInsert) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -534,7 +581,7 @@ func (x *MessageInsert) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageInsert.ProtoReflect.Descriptor instead. func (*MessageInsert) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{6} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{7} } func (x *MessageInsert) GetRecord() []byte { @@ -565,7 +612,7 @@ type MessageDeleteStale struct { func (x *MessageDeleteStale) Reset() { *x = MessageDeleteStale{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -578,7 +625,7 @@ func (x *MessageDeleteStale) String() string { func (*MessageDeleteStale) ProtoMessage() {} func (x *MessageDeleteStale) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -591,7 +638,7 @@ func (x *MessageDeleteStale) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageDeleteStale.ProtoReflect.Descriptor instead. func (*MessageDeleteStale) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{7} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8} } func (x *MessageDeleteStale) GetTable() []byte { @@ -624,7 +671,7 @@ type Sync struct { func (x *Sync) Reset() { *x = Sync{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -637,7 +684,7 @@ func (x *Sync) String() string { func (*Sync) ProtoMessage() {} func (x *Sync) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -650,7 +697,7 @@ func (x *Sync) ProtoReflect() protoreflect.Message { // Deprecated: Use Sync.ProtoReflect.Descriptor instead. func (*Sync) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9} } type Write struct { @@ -662,7 +709,7 @@ type Write struct { func (x *Write) Reset() { *x = Write{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -675,7 +722,7 @@ func (x *Write) String() string { func (*Write) ProtoMessage() {} func (x *Write) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -688,7 +735,7 @@ func (x *Write) ProtoReflect() protoreflect.Message { // Deprecated: Use Write.ProtoReflect.Descriptor instead. func (*Write) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10} } type Close struct { @@ -700,7 +747,7 @@ type Close struct { func (x *Close) Reset() { *x = Close{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -713,7 +760,7 @@ func (x *Close) String() string { func (*Close) ProtoMessage() {} func (x *Close) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -726,7 +773,7 @@ func (x *Close) ProtoReflect() protoreflect.Message { // Deprecated: Use Close.ProtoReflect.Descriptor instead. func (*Close) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{11} } type GetName_Request struct { @@ -738,7 +785,7 @@ type GetName_Request struct { func (x *GetName_Request) Reset() { *x = GetName_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -751,7 +798,7 @@ func (x *GetName_Request) String() string { func (*GetName_Request) ProtoMessage() {} func (x *GetName_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -778,7 +825,7 @@ type GetName_Response struct { func (x *GetName_Response) Reset() { *x = GetName_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -791,7 +838,7 @@ func (x *GetName_Response) String() string { func (*GetName_Response) ProtoMessage() {} func (x *GetName_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -823,7 +870,7 @@ type GetVersion_Request struct { func (x *GetVersion_Request) Reset() { *x = GetVersion_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -836,7 +883,7 @@ func (x *GetVersion_Request) String() string { func (*GetVersion_Request) ProtoMessage() {} func (x *GetVersion_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +910,7 @@ type GetVersion_Response struct { func (x *GetVersion_Response) Reset() { *x = GetVersion_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -876,7 +923,7 @@ func (x *GetVersion_Response) String() string { func (*GetVersion_Response) ProtoMessage() {} func (x *GetVersion_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -910,7 +957,7 @@ type Init_Request struct { func (x *Init_Request) Reset() { *x = Init_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -923,7 +970,7 @@ func (x *Init_Request) String() string { func (*Init_Request) ProtoMessage() {} func (x *Init_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -955,7 +1002,7 @@ type Init_Response struct { func (x *Init_Response) Reset() { *x = Init_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -968,7 +1015,7 @@ func (x *Init_Response) String() string { func (*Init_Response) ProtoMessage() {} func (x *Init_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -996,7 +1043,7 @@ type GetTables_Request struct { func (x *GetTables_Request) Reset() { *x = GetTables_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1009,7 +1056,7 @@ func (x *GetTables_Request) String() string { func (*GetTables_Request) ProtoMessage() {} func (x *GetTables_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1051,7 +1098,7 @@ type GetTables_Response struct { func (x *GetTables_Response) Reset() { *x = GetTables_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1064,7 +1111,7 @@ func (x *GetTables_Response) String() string { func (*GetTables_Response) ProtoMessage() {} func (x *GetTables_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1102,7 +1149,7 @@ type Sync_Request struct { func (x *Sync_Request) Reset() { *x = Sync_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1115,7 +1162,7 @@ func (x *Sync_Request) String() string { func (*Sync_Request) ProtoMessage() {} func (x *Sync_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1128,7 +1175,7 @@ func (x *Sync_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Sync_Request.ProtoReflect.Descriptor instead. func (*Sync_Request) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8, 0} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 0} } func (x *Sync_Request) GetTables() []string { @@ -1182,7 +1229,7 @@ type Sync_Response struct { func (x *Sync_Response) Reset() { *x = Sync_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1195,7 +1242,7 @@ func (x *Sync_Response) String() string { func (*Sync_Response) ProtoMessage() {} func (x *Sync_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1208,7 +1255,7 @@ func (x *Sync_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Sync_Response.ProtoReflect.Descriptor instead. func (*Sync_Response) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8, 1} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 1} } func (m *Sync_Response) GetMessage() isSync_Response_Message { @@ -1268,6 +1315,7 @@ type Write_Request struct { // Types that are assignable to Message: // + // *Write_Request_Options // *Write_Request_CreateTable // *Write_Request_Insert // *Write_Request_Delete @@ -1277,7 +1325,7 @@ type Write_Request struct { func (x *Write_Request) Reset() { *x = Write_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1290,7 +1338,7 @@ func (x *Write_Request) String() string { func (*Write_Request) ProtoMessage() {} func (x *Write_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1303,7 +1351,7 @@ func (x *Write_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Write_Request.ProtoReflect.Descriptor instead. func (*Write_Request) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 0} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 0} } func (m *Write_Request) GetMessage() isWrite_Request_Message { @@ -1313,6 +1361,13 @@ func (m *Write_Request) GetMessage() isWrite_Request_Message { return nil } +func (x *Write_Request) GetOptions() *WriteOptions { + if x, ok := x.GetMessage().(*Write_Request_Options); ok { + return x.Options + } + return nil +} + func (x *Write_Request) GetCreateTable() *MessageCreateTable { if x, ok := x.GetMessage().(*Write_Request_CreateTable); ok { return x.CreateTable @@ -1338,18 +1393,24 @@ type isWrite_Request_Message interface { isWrite_Request_Message() } +type Write_Request_Options struct { + Options *WriteOptions `protobuf:"bytes,1,opt,name=options,proto3,oneof"` +} + type Write_Request_CreateTable struct { - CreateTable *MessageCreateTable `protobuf:"bytes,1,opt,name=create_table,json=createTable,proto3,oneof"` + CreateTable *MessageCreateTable `protobuf:"bytes,2,opt,name=create_table,json=createTable,proto3,oneof"` } type Write_Request_Insert struct { - Insert *MessageInsert `protobuf:"bytes,2,opt,name=insert,proto3,oneof"` + Insert *MessageInsert `protobuf:"bytes,3,opt,name=insert,proto3,oneof"` } type Write_Request_Delete struct { - Delete *MessageDeleteStale `protobuf:"bytes,3,opt,name=delete,proto3,oneof"` + Delete *MessageDeleteStale `protobuf:"bytes,4,opt,name=delete,proto3,oneof"` } +func (*Write_Request_Options) isWrite_Request_Message() {} + func (*Write_Request_CreateTable) isWrite_Request_Message() {} func (*Write_Request_Insert) isWrite_Request_Message() {} @@ -1365,7 +1426,7 @@ type Write_Response struct { func (x *Write_Response) Reset() { *x = Write_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1378,7 +1439,7 @@ func (x *Write_Response) String() string { func (*Write_Response) ProtoMessage() {} func (x *Write_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1391,7 +1452,7 @@ func (x *Write_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Write_Response.ProtoReflect.Descriptor instead. func (*Write_Response) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 1} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 1} } type Close_Request struct { @@ -1403,7 +1464,7 @@ type Close_Request struct { func (x *Close_Request) Reset() { *x = Close_Request{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1416,7 +1477,7 @@ func (x *Close_Request) String() string { func (*Close_Request) ProtoMessage() {} func (x *Close_Request) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1429,7 +1490,7 @@ func (x *Close_Request) ProtoReflect() protoreflect.Message { // Deprecated: Use Close_Request.ProtoReflect.Descriptor instead. func (*Close_Request) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 0} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{11, 0} } type Close_Response struct { @@ -1441,7 +1502,7 @@ type Close_Response struct { func (x *Close_Response) Reset() { *x = Close_Response{} if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1454,7 +1515,7 @@ func (x *Close_Response) String() string { func (*Close_Response) ProtoMessage() {} func (x *Close_Response) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24] + mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1467,7 +1528,7 @@ func (x *Close_Response) ProtoReflect() protoreflect.Message { // Deprecated: Use Close_Response.ProtoReflect.Descriptor instead. func (*Close_Response) Descriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 1} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{11, 1} } var File_plugin_pb_plugin_v3_plugin_proto protoreflect.FileDescriptor @@ -1506,130 +1567,137 @@ var file_plugin_pb_plugin_v3_plugin_proto_rawDesc = []byte{ 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x1a, 0x22, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x4f, 0x0a, - 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x69, 0x67, - 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x3f, - 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x70, 0x73, 0x65, 0x72, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x22, - 0x84, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, - 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x73, 0x79, - 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe3, 0x03, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x1a, - 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, - 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x62, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, - 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, - 0x6e, 0x64, 0x1a, 0xe7, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, - 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, - 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x33, 0x0a, + 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, + 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, + 0x63, 0x65, 0x22, 0x4f, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, + 0x72, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe3, 0x03, 0x0a, 0x04, + 0x53, 0x79, 0x6e, 0x63, 0x1a, 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, + 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, + 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x73, + 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, - 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, - 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xfc, 0x01, 0x0a, - 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, 0xe6, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, + 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0xe7, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, + 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0xbc, 0x02, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, 0xa6, 0x02, 0x0a, 0x07, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, - 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, - 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x43, - 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x46, 0x0a, 0x08, 0x52, - 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, - 0x54, 0x52, 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, - 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, - 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, - 0x4c, 0x10, 0x02, 0x2a, 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, - 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, - 0x53, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, - 0x5f, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x24, - 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, - 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, - 0x41, 0x4e, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x12, - 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, - 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x32, 0xf3, 0x04, 0x0a, - 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, - 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, - 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, - 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, - 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, + 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x1e, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, + 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, + 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, + 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, + 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, + 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, + 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, + 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, + 0x4e, 0x10, 0x01, 0x2a, 0x24, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, + 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, + 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, + 0x4d, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, + 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, + 0x01, 0x32, 0xf3, 0x04, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, + 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, + 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, + 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, + 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, + 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, + 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, + 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, + 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x52, - 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, - 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, + 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, + 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1645,7 +1713,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP() []byte { } var file_plugin_pb_plugin_v3_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_plugin_pb_plugin_v3_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_plugin_pb_plugin_v3_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_plugin_pb_plugin_v3_plugin_proto_goTypes = []interface{}{ (REGISTRY)(0), // 0: cloudquery.plugin.v3.REGISTRY (SCHEDULER)(0), // 1: cloudquery.plugin.v3.SCHEDULER @@ -1656,58 +1724,60 @@ var file_plugin_pb_plugin_v3_plugin_proto_goTypes = []interface{}{ (*GetVersion)(nil), // 6: cloudquery.plugin.v3.GetVersion (*Init)(nil), // 7: cloudquery.plugin.v3.Init (*GetTables)(nil), // 8: cloudquery.plugin.v3.GetTables - (*MessageCreateTable)(nil), // 9: cloudquery.plugin.v3.MessageCreateTable - (*MessageInsert)(nil), // 10: cloudquery.plugin.v3.MessageInsert - (*MessageDeleteStale)(nil), // 11: cloudquery.plugin.v3.MessageDeleteStale - (*Sync)(nil), // 12: cloudquery.plugin.v3.Sync - (*Write)(nil), // 13: cloudquery.plugin.v3.Write - (*Close)(nil), // 14: cloudquery.plugin.v3.Close - (*GetName_Request)(nil), // 15: cloudquery.plugin.v3.GetName.Request - (*GetName_Response)(nil), // 16: cloudquery.plugin.v3.GetName.Response - (*GetVersion_Request)(nil), // 17: cloudquery.plugin.v3.GetVersion.Request - (*GetVersion_Response)(nil), // 18: cloudquery.plugin.v3.GetVersion.Response - (*Init_Request)(nil), // 19: cloudquery.plugin.v3.Init.Request - (*Init_Response)(nil), // 20: cloudquery.plugin.v3.Init.Response - (*GetTables_Request)(nil), // 21: cloudquery.plugin.v3.GetTables.Request - (*GetTables_Response)(nil), // 22: cloudquery.plugin.v3.GetTables.Response - (*Sync_Request)(nil), // 23: cloudquery.plugin.v3.Sync.Request - (*Sync_Response)(nil), // 24: cloudquery.plugin.v3.Sync.Response - (*Write_Request)(nil), // 25: cloudquery.plugin.v3.Write.Request - (*Write_Response)(nil), // 26: cloudquery.plugin.v3.Write.Response - (*Close_Request)(nil), // 27: cloudquery.plugin.v3.Close.Request - (*Close_Response)(nil), // 28: cloudquery.plugin.v3.Close.Response - (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp + (*WriteOptions)(nil), // 9: cloudquery.plugin.v3.WriteOptions + (*MessageCreateTable)(nil), // 10: cloudquery.plugin.v3.MessageCreateTable + (*MessageInsert)(nil), // 11: cloudquery.plugin.v3.MessageInsert + (*MessageDeleteStale)(nil), // 12: cloudquery.plugin.v3.MessageDeleteStale + (*Sync)(nil), // 13: cloudquery.plugin.v3.Sync + (*Write)(nil), // 14: cloudquery.plugin.v3.Write + (*Close)(nil), // 15: cloudquery.plugin.v3.Close + (*GetName_Request)(nil), // 16: cloudquery.plugin.v3.GetName.Request + (*GetName_Response)(nil), // 17: cloudquery.plugin.v3.GetName.Response + (*GetVersion_Request)(nil), // 18: cloudquery.plugin.v3.GetVersion.Request + (*GetVersion_Response)(nil), // 19: cloudquery.plugin.v3.GetVersion.Response + (*Init_Request)(nil), // 20: cloudquery.plugin.v3.Init.Request + (*Init_Response)(nil), // 21: cloudquery.plugin.v3.Init.Response + (*GetTables_Request)(nil), // 22: cloudquery.plugin.v3.GetTables.Request + (*GetTables_Response)(nil), // 23: cloudquery.plugin.v3.GetTables.Response + (*Sync_Request)(nil), // 24: cloudquery.plugin.v3.Sync.Request + (*Sync_Response)(nil), // 25: cloudquery.plugin.v3.Sync.Response + (*Write_Request)(nil), // 26: cloudquery.plugin.v3.Write.Request + (*Write_Response)(nil), // 27: cloudquery.plugin.v3.Write.Response + (*Close_Request)(nil), // 28: cloudquery.plugin.v3.Close.Request + (*Close_Response)(nil), // 29: cloudquery.plugin.v3.Close.Response + (*timestamppb.Timestamp)(nil), // 30: google.protobuf.Timestamp } var file_plugin_pb_plugin_v3_plugin_proto_depIdxs = []int32{ 0, // 0: cloudquery.plugin.v3.StateBackendSpec.registry:type_name -> cloudquery.plugin.v3.REGISTRY - 29, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp + 30, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp 1, // 2: cloudquery.plugin.v3.Sync.Request.scheduler:type_name -> cloudquery.plugin.v3.SCHEDULER 4, // 3: cloudquery.plugin.v3.Sync.Request.state_backend:type_name -> cloudquery.plugin.v3.StateBackendSpec - 9, // 4: cloudquery.plugin.v3.Sync.Response.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable - 10, // 5: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert - 11, // 6: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale - 9, // 7: cloudquery.plugin.v3.Write.Request.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable - 10, // 8: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert - 11, // 9: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale - 15, // 10: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request - 17, // 11: cloudquery.plugin.v3.Plugin.GetVersion:input_type -> cloudquery.plugin.v3.GetVersion.Request - 19, // 12: cloudquery.plugin.v3.Plugin.Init:input_type -> cloudquery.plugin.v3.Init.Request - 21, // 13: cloudquery.plugin.v3.Plugin.GetTables:input_type -> cloudquery.plugin.v3.GetTables.Request - 23, // 14: cloudquery.plugin.v3.Plugin.Sync:input_type -> cloudquery.plugin.v3.Sync.Request - 25, // 15: cloudquery.plugin.v3.Plugin.Write:input_type -> cloudquery.plugin.v3.Write.Request - 27, // 16: cloudquery.plugin.v3.Plugin.Close:input_type -> cloudquery.plugin.v3.Close.Request - 16, // 17: cloudquery.plugin.v3.Plugin.GetName:output_type -> cloudquery.plugin.v3.GetName.Response - 18, // 18: cloudquery.plugin.v3.Plugin.GetVersion:output_type -> cloudquery.plugin.v3.GetVersion.Response - 20, // 19: cloudquery.plugin.v3.Plugin.Init:output_type -> cloudquery.plugin.v3.Init.Response - 22, // 20: cloudquery.plugin.v3.Plugin.GetTables:output_type -> cloudquery.plugin.v3.GetTables.Response - 24, // 21: cloudquery.plugin.v3.Plugin.Sync:output_type -> cloudquery.plugin.v3.Sync.Response - 26, // 22: cloudquery.plugin.v3.Plugin.Write:output_type -> cloudquery.plugin.v3.Write.Response - 28, // 23: cloudquery.plugin.v3.Plugin.Close:output_type -> cloudquery.plugin.v3.Close.Response - 17, // [17:24] is the sub-list for method output_type - 10, // [10:17] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 10, // 4: cloudquery.plugin.v3.Sync.Response.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 11, // 5: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 12, // 6: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 9, // 7: cloudquery.plugin.v3.Write.Request.options:type_name -> cloudquery.plugin.v3.WriteOptions + 10, // 8: cloudquery.plugin.v3.Write.Request.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 11, // 9: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 12, // 10: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 16, // 11: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request + 18, // 12: cloudquery.plugin.v3.Plugin.GetVersion:input_type -> cloudquery.plugin.v3.GetVersion.Request + 20, // 13: cloudquery.plugin.v3.Plugin.Init:input_type -> cloudquery.plugin.v3.Init.Request + 22, // 14: cloudquery.plugin.v3.Plugin.GetTables:input_type -> cloudquery.plugin.v3.GetTables.Request + 24, // 15: cloudquery.plugin.v3.Plugin.Sync:input_type -> cloudquery.plugin.v3.Sync.Request + 26, // 16: cloudquery.plugin.v3.Plugin.Write:input_type -> cloudquery.plugin.v3.Write.Request + 28, // 17: cloudquery.plugin.v3.Plugin.Close:input_type -> cloudquery.plugin.v3.Close.Request + 17, // 18: cloudquery.plugin.v3.Plugin.GetName:output_type -> cloudquery.plugin.v3.GetName.Response + 19, // 19: cloudquery.plugin.v3.Plugin.GetVersion:output_type -> cloudquery.plugin.v3.GetVersion.Response + 21, // 20: cloudquery.plugin.v3.Plugin.Init:output_type -> cloudquery.plugin.v3.Init.Response + 23, // 21: cloudquery.plugin.v3.Plugin.GetTables:output_type -> cloudquery.plugin.v3.GetTables.Response + 25, // 22: cloudquery.plugin.v3.Plugin.Sync:output_type -> cloudquery.plugin.v3.Sync.Response + 27, // 23: cloudquery.plugin.v3.Plugin.Write:output_type -> cloudquery.plugin.v3.Write.Response + 29, // 24: cloudquery.plugin.v3.Plugin.Close:output_type -> cloudquery.plugin.v3.Close.Response + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_plugin_pb_plugin_v3_plugin_proto_init() } @@ -1777,7 +1847,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageCreateTable); i { + switch v := v.(*WriteOptions); i { case 0: return &v.state case 1: @@ -1789,7 +1859,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageInsert); i { + switch v := v.(*MessageCreateTable); i { case 0: return &v.state case 1: @@ -1801,7 +1871,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageDeleteStale); i { + switch v := v.(*MessageInsert); i { case 0: return &v.state case 1: @@ -1813,7 +1883,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sync); i { + switch v := v.(*MessageDeleteStale); i { case 0: return &v.state case 1: @@ -1825,7 +1895,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Write); i { + switch v := v.(*Sync); i { case 0: return &v.state case 1: @@ -1837,7 +1907,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Close); i { + switch v := v.(*Write); i { case 0: return &v.state case 1: @@ -1849,7 +1919,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetName_Request); i { + switch v := v.(*Close); i { case 0: return &v.state case 1: @@ -1861,7 +1931,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetName_Response); i { + switch v := v.(*GetName_Request); i { case 0: return &v.state case 1: @@ -1873,7 +1943,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVersion_Request); i { + switch v := v.(*GetName_Response); i { case 0: return &v.state case 1: @@ -1885,7 +1955,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetVersion_Response); i { + switch v := v.(*GetVersion_Request); i { case 0: return &v.state case 1: @@ -1897,7 +1967,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Init_Request); i { + switch v := v.(*GetVersion_Response); i { case 0: return &v.state case 1: @@ -1909,7 +1979,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Init_Response); i { + switch v := v.(*Init_Request); i { case 0: return &v.state case 1: @@ -1921,7 +1991,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTables_Request); i { + switch v := v.(*Init_Response); i { case 0: return &v.state case 1: @@ -1933,7 +2003,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTables_Response); i { + switch v := v.(*GetTables_Request); i { case 0: return &v.state case 1: @@ -1945,7 +2015,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sync_Request); i { + switch v := v.(*GetTables_Response); i { case 0: return &v.state case 1: @@ -1957,7 +2027,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sync_Response); i { + switch v := v.(*Sync_Request); i { case 0: return &v.state case 1: @@ -1969,7 +2039,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Write_Request); i { + switch v := v.(*Sync_Response); i { case 0: return &v.state case 1: @@ -1981,7 +2051,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Write_Response); i { + switch v := v.(*Write_Request); i { case 0: return &v.state case 1: @@ -1993,7 +2063,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Close_Request); i { + switch v := v.(*Write_Response); i { case 0: return &v.state case 1: @@ -2005,6 +2075,18 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Close_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Close_Response); i { case 0: return &v.state @@ -2017,12 +2099,13 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } } - file_plugin_pb_plugin_v3_plugin_proto_msgTypes[20].OneofWrappers = []interface{}{ + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].OneofWrappers = []interface{}{ (*Sync_Response_CreateTable)(nil), (*Sync_Response_Insert)(nil), (*Sync_Response_Delete)(nil), } - file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].OneofWrappers = []interface{}{ + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22].OneofWrappers = []interface{}{ + (*Write_Request_Options)(nil), (*Write_Request_CreateTable)(nil), (*Write_Request_Insert)(nil), (*Write_Request_Delete)(nil), @@ -2033,7 +2116,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_pb_plugin_v3_plugin_proto_rawDesc, NumEnums: 4, - NumMessages: 25, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, From b650d24e862ab8bcc1f294560eef6a02b26b035b Mon Sep 17 00:00:00 2001 From: Herman Schaaf Date: Fri, 16 Jun 2023 13:23:04 +0100 Subject: [PATCH 3/6] Update proto --- pb/destination/v0/destination_grpc.pb.go | 51 ++-- pb/destination/v1/destination_grpc.pb.go | 43 ++-- pb/discovery/v0/discovery_grpc.pb.go | 10 +- pb/discovery/v1/discovery_grpc.pb.go | 10 +- pb/plugin/v3/plugin.pb.go | 304 +++++++++++------------ pb/plugin/v3/plugin_grpc.pb.go | 36 ++- pb/source/v0/source_grpc.pb.go | 46 ++-- pb/source/v1/source_grpc.pb.go | 43 ++-- pb/source/v2/source_grpc.pb.go | 43 ++-- 9 files changed, 330 insertions(+), 256 deletions(-) diff --git a/pb/destination/v0/destination_grpc.pb.go b/pb/destination/v0/destination_grpc.pb.go index 689b5a98..5adc2d8a 100644 --- a/pb/destination/v0/destination_grpc.pb.go +++ b/pb/destination/v0/destination_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/destination/v0/destination.proto @@ -19,6 +19,19 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Destination_GetProtocolVersion_FullMethodName = "/proto.Destination/GetProtocolVersion" + Destination_GetName_FullMethodName = "/proto.Destination/GetName" + Destination_GetVersion_FullMethodName = "/proto.Destination/GetVersion" + Destination_Configure_FullMethodName = "/proto.Destination/Configure" + Destination_Migrate_FullMethodName = "/proto.Destination/Migrate" + Destination_Write_FullMethodName = "/proto.Destination/Write" + Destination_Write2_FullMethodName = "/proto.Destination/Write2" + Destination_Close_FullMethodName = "/proto.Destination/Close" + Destination_DeleteStale_FullMethodName = "/proto.Destination/DeleteStale" + Destination_GetMetrics_FullMethodName = "/proto.Destination/GetMetrics" +) + // DestinationClient is the client API for Destination 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. @@ -58,7 +71,7 @@ func NewDestinationClient(cc grpc.ClientConnInterface) DestinationClient { func (c *destinationClient) GetProtocolVersion(ctx context.Context, in *v0.GetProtocolVersion_Request, opts ...grpc.CallOption) (*v0.GetProtocolVersion_Response, error) { out := new(v0.GetProtocolVersion_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/GetProtocolVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetProtocolVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -67,7 +80,7 @@ func (c *destinationClient) GetProtocolVersion(ctx context.Context, in *v0.GetPr func (c *destinationClient) GetName(ctx context.Context, in *v0.GetName_Request, opts ...grpc.CallOption) (*v0.GetName_Response, error) { out := new(v0.GetName_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +89,7 @@ func (c *destinationClient) GetName(ctx context.Context, in *v0.GetName_Request, func (c *destinationClient) GetVersion(ctx context.Context, in *v0.GetVersion_Request, opts ...grpc.CallOption) (*v0.GetVersion_Response, error) { out := new(v0.GetVersion_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -85,7 +98,7 @@ func (c *destinationClient) GetVersion(ctx context.Context, in *v0.GetVersion_Re func (c *destinationClient) Configure(ctx context.Context, in *v0.Configure_Request, opts ...grpc.CallOption) (*v0.Configure_Response, error) { out := new(v0.Configure_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/Configure", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Configure_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -94,7 +107,7 @@ func (c *destinationClient) Configure(ctx context.Context, in *v0.Configure_Requ func (c *destinationClient) Migrate(ctx context.Context, in *Migrate_Request, opts ...grpc.CallOption) (*Migrate_Response, error) { out := new(Migrate_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/Migrate", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Migrate_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -102,7 +115,7 @@ func (c *destinationClient) Migrate(ctx context.Context, in *Migrate_Request, op } func (c *destinationClient) Write(ctx context.Context, opts ...grpc.CallOption) (Destination_WriteClient, error) { - stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[0], "/proto.Destination/Write", opts...) + stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[0], Destination_Write_FullMethodName, opts...) if err != nil { return nil, err } @@ -136,7 +149,7 @@ func (x *destinationWriteClient) CloseAndRecv() (*Write_Response, error) { } func (c *destinationClient) Write2(ctx context.Context, opts ...grpc.CallOption) (Destination_Write2Client, error) { - stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[1], "/proto.Destination/Write2", opts...) + stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[1], Destination_Write2_FullMethodName, opts...) if err != nil { return nil, err } @@ -171,7 +184,7 @@ func (x *destinationWrite2Client) CloseAndRecv() (*Write2_Response, error) { func (c *destinationClient) Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) { out := new(Close_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/Close", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Close_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -180,7 +193,7 @@ func (c *destinationClient) Close(ctx context.Context, in *Close_Request, opts . func (c *destinationClient) DeleteStale(ctx context.Context, in *DeleteStale_Request, opts ...grpc.CallOption) (*DeleteStale_Response, error) { out := new(DeleteStale_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/DeleteStale", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_DeleteStale_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -189,7 +202,7 @@ func (c *destinationClient) DeleteStale(ctx context.Context, in *DeleteStale_Req func (c *destinationClient) GetMetrics(ctx context.Context, in *GetDestinationMetrics_Request, opts ...grpc.CallOption) (*GetDestinationMetrics_Response, error) { out := new(GetDestinationMetrics_Response) - err := c.cc.Invoke(ctx, "/proto.Destination/GetMetrics", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetMetrics_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -283,7 +296,7 @@ func _Destination_GetProtocolVersion_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/GetProtocolVersion", + FullMethod: Destination_GetProtocolVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetProtocolVersion(ctx, req.(*v0.GetProtocolVersion_Request)) @@ -301,7 +314,7 @@ func _Destination_GetName_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/GetName", + FullMethod: Destination_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetName(ctx, req.(*v0.GetName_Request)) @@ -319,7 +332,7 @@ func _Destination_GetVersion_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/GetVersion", + FullMethod: Destination_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetVersion(ctx, req.(*v0.GetVersion_Request)) @@ -337,7 +350,7 @@ func _Destination_Configure_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/Configure", + FullMethod: Destination_Configure_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Configure(ctx, req.(*v0.Configure_Request)) @@ -355,7 +368,7 @@ func _Destination_Migrate_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/Migrate", + FullMethod: Destination_Migrate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Migrate(ctx, req.(*Migrate_Request)) @@ -425,7 +438,7 @@ func _Destination_Close_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/Close", + FullMethod: Destination_Close_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Close(ctx, req.(*Close_Request)) @@ -443,7 +456,7 @@ func _Destination_DeleteStale_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/DeleteStale", + FullMethod: Destination_DeleteStale_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).DeleteStale(ctx, req.(*DeleteStale_Request)) @@ -461,7 +474,7 @@ func _Destination_GetMetrics_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Destination/GetMetrics", + FullMethod: Destination_GetMetrics_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetMetrics(ctx, req.(*GetDestinationMetrics_Request)) diff --git a/pb/destination/v1/destination_grpc.pb.go b/pb/destination/v1/destination_grpc.pb.go index ce49a1aa..1589af11 100644 --- a/pb/destination/v1/destination_grpc.pb.go +++ b/pb/destination/v1/destination_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/destination/v1/destination.proto @@ -18,6 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Destination_GetName_FullMethodName = "/cloudquery.destination.v1.Destination/GetName" + Destination_GetVersion_FullMethodName = "/cloudquery.destination.v1.Destination/GetVersion" + Destination_Configure_FullMethodName = "/cloudquery.destination.v1.Destination/Configure" + Destination_Migrate_FullMethodName = "/cloudquery.destination.v1.Destination/Migrate" + Destination_Write_FullMethodName = "/cloudquery.destination.v1.Destination/Write" + Destination_Close_FullMethodName = "/cloudquery.destination.v1.Destination/Close" + Destination_DeleteStale_FullMethodName = "/cloudquery.destination.v1.Destination/DeleteStale" + Destination_GetMetrics_FullMethodName = "/cloudquery.destination.v1.Destination/GetMetrics" +) + // DestinationClient is the client API for Destination 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. @@ -51,7 +62,7 @@ func NewDestinationClient(cc grpc.ClientConnInterface) DestinationClient { func (c *destinationClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { out := new(GetName_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -60,7 +71,7 @@ func (c *destinationClient) GetName(ctx context.Context, in *GetName_Request, op func (c *destinationClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { out := new(GetVersion_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -69,7 +80,7 @@ func (c *destinationClient) GetVersion(ctx context.Context, in *GetVersion_Reque func (c *destinationClient) Configure(ctx context.Context, in *Configure_Request, opts ...grpc.CallOption) (*Configure_Response, error) { out := new(Configure_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/Configure", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Configure_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -78,7 +89,7 @@ func (c *destinationClient) Configure(ctx context.Context, in *Configure_Request func (c *destinationClient) Migrate(ctx context.Context, in *Migrate_Request, opts ...grpc.CallOption) (*Migrate_Response, error) { out := new(Migrate_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/Migrate", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Migrate_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -86,7 +97,7 @@ func (c *destinationClient) Migrate(ctx context.Context, in *Migrate_Request, op } func (c *destinationClient) Write(ctx context.Context, opts ...grpc.CallOption) (Destination_WriteClient, error) { - stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[0], "/cloudquery.destination.v1.Destination/Write", opts...) + stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[0], Destination_Write_FullMethodName, opts...) if err != nil { return nil, err } @@ -121,7 +132,7 @@ func (x *destinationWriteClient) CloseAndRecv() (*Write_Response, error) { func (c *destinationClient) Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) { out := new(Close_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/Close", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_Close_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -130,7 +141,7 @@ func (c *destinationClient) Close(ctx context.Context, in *Close_Request, opts . func (c *destinationClient) DeleteStale(ctx context.Context, in *DeleteStale_Request, opts ...grpc.CallOption) (*DeleteStale_Response, error) { out := new(DeleteStale_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/DeleteStale", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_DeleteStale_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -139,7 +150,7 @@ func (c *destinationClient) DeleteStale(ctx context.Context, in *DeleteStale_Req func (c *destinationClient) GetMetrics(ctx context.Context, in *GetDestinationMetrics_Request, opts ...grpc.CallOption) (*GetDestinationMetrics_Response, error) { out := new(GetDestinationMetrics_Response) - err := c.cc.Invoke(ctx, "/cloudquery.destination.v1.Destination/GetMetrics", in, out, opts...) + err := c.cc.Invoke(ctx, Destination_GetMetrics_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -221,7 +232,7 @@ func _Destination_GetName_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/GetName", + FullMethod: Destination_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetName(ctx, req.(*GetName_Request)) @@ -239,7 +250,7 @@ func _Destination_GetVersion_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/GetVersion", + FullMethod: Destination_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetVersion(ctx, req.(*GetVersion_Request)) @@ -257,7 +268,7 @@ func _Destination_Configure_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/Configure", + FullMethod: Destination_Configure_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Configure(ctx, req.(*Configure_Request)) @@ -275,7 +286,7 @@ func _Destination_Migrate_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/Migrate", + FullMethod: Destination_Migrate_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Migrate(ctx, req.(*Migrate_Request)) @@ -319,7 +330,7 @@ func _Destination_Close_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/Close", + FullMethod: Destination_Close_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).Close(ctx, req.(*Close_Request)) @@ -337,7 +348,7 @@ func _Destination_DeleteStale_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/DeleteStale", + FullMethod: Destination_DeleteStale_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).DeleteStale(ctx, req.(*DeleteStale_Request)) @@ -355,7 +366,7 @@ func _Destination_GetMetrics_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.destination.v1.Destination/GetMetrics", + FullMethod: Destination_GetMetrics_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DestinationServer).GetMetrics(ctx, req.(*GetDestinationMetrics_Request)) diff --git a/pb/discovery/v0/discovery_grpc.pb.go b/pb/discovery/v0/discovery_grpc.pb.go index 122977b8..6a879657 100644 --- a/pb/discovery/v0/discovery_grpc.pb.go +++ b/pb/discovery/v0/discovery_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/discovery/v0/discovery.proto @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Discovery_GetVersions_FullMethodName = "/cloudquery.discovery.v0.Discovery/GetVersions" +) + // DiscoveryClient is the client API for Discovery 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. @@ -36,7 +40,7 @@ func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient { func (c *discoveryClient) GetVersions(ctx context.Context, in *GetVersions_Request, opts ...grpc.CallOption) (*GetVersions_Response, error) { out := new(GetVersions_Response) - err := c.cc.Invoke(ctx, "/cloudquery.discovery.v0.Discovery/GetVersions", in, out, opts...) + err := c.cc.Invoke(ctx, Discovery_GetVersions_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -82,7 +86,7 @@ func _Discovery_GetVersions_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.discovery.v0.Discovery/GetVersions", + FullMethod: Discovery_GetVersions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscoveryServer).GetVersions(ctx, req.(*GetVersions_Request)) diff --git a/pb/discovery/v1/discovery_grpc.pb.go b/pb/discovery/v1/discovery_grpc.pb.go index ee73dafe..9d0c4c4b 100644 --- a/pb/discovery/v1/discovery_grpc.pb.go +++ b/pb/discovery/v1/discovery_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/discovery/v1/discovery.proto @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Discovery_GetVersions_FullMethodName = "/cloudquery.discovery.v1.Discovery/GetVersions" +) + // DiscoveryClient is the client API for Discovery 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. @@ -36,7 +40,7 @@ func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient { func (c *discoveryClient) GetVersions(ctx context.Context, in *GetVersions_Request, opts ...grpc.CallOption) (*GetVersions_Response, error) { out := new(GetVersions_Response) - err := c.cc.Invoke(ctx, "/cloudquery.discovery.v1.Discovery/GetVersions", in, out, opts...) + err := c.cc.Invoke(ctx, Discovery_GetVersions_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -82,7 +86,7 @@ func _Discovery_GetVersions_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.discovery.v1.Discovery/GetVersions", + FullMethod: Discovery_GetVersions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscoveryServer).GetVersions(ctx, req.(*GetVersions_Request)) diff --git a/pb/plugin/v3/plugin.pb.go b/pb/plugin/v3/plugin.pb.go index 5a5fbe28..95a53576 100644 --- a/pb/plugin/v3/plugin.pb.go +++ b/pb/plugin/v3/plugin.pb.go @@ -486,7 +486,7 @@ func (x *WriteOptions) GetMigrateForce() bool { return false } -type MessageCreateTable struct { +type MessageMigrateTable struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -496,8 +496,8 @@ type MessageCreateTable struct { MigrateForce bool `protobuf:"varint,2,opt,name=migrate_force,json=migrateForce,proto3" json:"migrate_force,omitempty"` } -func (x *MessageCreateTable) Reset() { - *x = MessageCreateTable{} +func (x *MessageMigrateTable) Reset() { + *x = MessageMigrateTable{} if protoimpl.UnsafeEnabled { mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -505,13 +505,13 @@ func (x *MessageCreateTable) Reset() { } } -func (x *MessageCreateTable) String() string { +func (x *MessageMigrateTable) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MessageCreateTable) ProtoMessage() {} +func (*MessageMigrateTable) ProtoMessage() {} -func (x *MessageCreateTable) ProtoReflect() protoreflect.Message { +func (x *MessageMigrateTable) ProtoReflect() protoreflect.Message { mi := &file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -523,19 +523,19 @@ func (x *MessageCreateTable) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MessageCreateTable.ProtoReflect.Descriptor instead. -func (*MessageCreateTable) Descriptor() ([]byte, []int) { +// Deprecated: Use MessageMigrateTable.ProtoReflect.Descriptor instead. +func (*MessageMigrateTable) Descriptor() ([]byte, []int) { return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{6} } -func (x *MessageCreateTable) GetTable() []byte { +func (x *MessageMigrateTable) GetTable() []byte { if x != nil { return x.Table } return nil } -func (x *MessageCreateTable) GetMigrateForce() bool { +func (x *MessageMigrateTable) GetMigrateForce() bool { if x != nil { return x.MigrateForce } @@ -1219,8 +1219,7 @@ type Sync_Response struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Message: - // - // *Sync_Response_CreateTable + // *Sync_Response_MigrateTable // *Sync_Response_Insert // *Sync_Response_Delete Message isSync_Response_Message `protobuf_oneof:"message"` @@ -1265,9 +1264,9 @@ func (m *Sync_Response) GetMessage() isSync_Response_Message { return nil } -func (x *Sync_Response) GetCreateTable() *MessageCreateTable { - if x, ok := x.GetMessage().(*Sync_Response_CreateTable); ok { - return x.CreateTable +func (x *Sync_Response) GetMigrateTable() *MessageMigrateTable { + if x, ok := x.GetMessage().(*Sync_Response_MigrateTable); ok { + return x.MigrateTable } return nil } @@ -1290,8 +1289,8 @@ type isSync_Response_Message interface { isSync_Response_Message() } -type Sync_Response_CreateTable struct { - CreateTable *MessageCreateTable `protobuf:"bytes,1,opt,name=create_table,json=createTable,proto3,oneof"` +type Sync_Response_MigrateTable struct { + MigrateTable *MessageMigrateTable `protobuf:"bytes,1,opt,name=migrate_table,json=migrateTable,proto3,oneof"` } type Sync_Response_Insert struct { @@ -1302,7 +1301,7 @@ type Sync_Response_Delete struct { Delete *MessageDeleteStale `protobuf:"bytes,3,opt,name=delete,proto3,oneof"` } -func (*Sync_Response_CreateTable) isSync_Response_Message() {} +func (*Sync_Response_MigrateTable) isSync_Response_Message() {} func (*Sync_Response_Insert) isSync_Response_Message() {} @@ -1314,9 +1313,8 @@ type Write_Request struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Message: - // // *Write_Request_Options - // *Write_Request_CreateTable + // *Write_Request_MigrateTable // *Write_Request_Insert // *Write_Request_Delete Message isWrite_Request_Message `protobuf_oneof:"message"` @@ -1368,9 +1366,9 @@ func (x *Write_Request) GetOptions() *WriteOptions { return nil } -func (x *Write_Request) GetCreateTable() *MessageCreateTable { - if x, ok := x.GetMessage().(*Write_Request_CreateTable); ok { - return x.CreateTable +func (x *Write_Request) GetMigrateTable() *MessageMigrateTable { + if x, ok := x.GetMessage().(*Write_Request_MigrateTable); ok { + return x.MigrateTable } return nil } @@ -1397,8 +1395,8 @@ type Write_Request_Options struct { Options *WriteOptions `protobuf:"bytes,1,opt,name=options,proto3,oneof"` } -type Write_Request_CreateTable struct { - CreateTable *MessageCreateTable `protobuf:"bytes,2,opt,name=create_table,json=createTable,proto3,oneof"` +type Write_Request_MigrateTable struct { + MigrateTable *MessageMigrateTable `protobuf:"bytes,2,opt,name=migrate_table,json=migrateTable,proto3,oneof"` } type Write_Request_Insert struct { @@ -1411,7 +1409,7 @@ type Write_Request_Delete struct { func (*Write_Request_Options) isWrite_Request_Message() {} -func (*Write_Request_CreateTable) isWrite_Request_Message() {} +func (*Write_Request_MigrateTable) isWrite_Request_Message() {} func (*Write_Request_Insert) isWrite_Request_Message() {} @@ -1571,133 +1569,133 @@ var file_plugin_pb_plugin_v3_plugin_proto_rawDesc = []byte{ 0x0c, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, - 0x63, 0x65, 0x22, 0x4f, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6f, - 0x72, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x70, - 0x73, 0x65, 0x72, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe3, 0x03, 0x0a, 0x04, - 0x53, 0x79, 0x6e, 0x63, 0x1a, 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, - 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, - 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, - 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x73, - 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, - 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, - 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0xe7, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, - 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, - 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x63, 0x65, 0x22, 0x50, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x67, + 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x63, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x46, + 0x6f, 0x72, 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x0d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x70, 0x73, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, + 0x70, 0x73, 0x65, 0x72, 0x74, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe6, 0x03, 0x0a, + 0x04, 0x53, 0x79, 0x6e, 0x63, 0x1a, 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, + 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, + 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, + 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, + 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, + 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, + 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0xea, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, + 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, + 0xa9, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x48, 0x00, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x0d, 0x6d, + 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0xbc, 0x02, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, 0xa6, 0x02, 0x0a, 0x07, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, + 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, + 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, - 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, - 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x1e, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, - 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, - 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, - 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, - 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, - 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, - 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, - 0x4e, 0x10, 0x01, 0x2a, 0x24, 0x0a, 0x08, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, - 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, - 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, - 0x4d, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, - 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, - 0x01, 0x32, 0xf3, 0x04, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, - 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, - 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, + 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, + 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, + 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, + 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x47, 0x49, + 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x52, + 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x2a, + 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, + 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, + 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, + 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x24, 0x0a, 0x08, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, + 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, + 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, + 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x32, 0xf3, 0x04, 0x0a, 0x06, 0x50, 0x6c, 0x75, + 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, - 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, - 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, - 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x27, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, - 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, - 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, + 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, - 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x27, + 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, + 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, + 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, + 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x2e, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x05, 0x43, 0x6c, + 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, + 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, + 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, + 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, + 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1725,7 +1723,7 @@ var file_plugin_pb_plugin_v3_plugin_proto_goTypes = []interface{}{ (*Init)(nil), // 7: cloudquery.plugin.v3.Init (*GetTables)(nil), // 8: cloudquery.plugin.v3.GetTables (*WriteOptions)(nil), // 9: cloudquery.plugin.v3.WriteOptions - (*MessageCreateTable)(nil), // 10: cloudquery.plugin.v3.MessageCreateTable + (*MessageMigrateTable)(nil), // 10: cloudquery.plugin.v3.MessageMigrateTable (*MessageInsert)(nil), // 11: cloudquery.plugin.v3.MessageInsert (*MessageDeleteStale)(nil), // 12: cloudquery.plugin.v3.MessageDeleteStale (*Sync)(nil), // 13: cloudquery.plugin.v3.Sync @@ -1752,11 +1750,11 @@ var file_plugin_pb_plugin_v3_plugin_proto_depIdxs = []int32{ 30, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp 1, // 2: cloudquery.plugin.v3.Sync.Request.scheduler:type_name -> cloudquery.plugin.v3.SCHEDULER 4, // 3: cloudquery.plugin.v3.Sync.Request.state_backend:type_name -> cloudquery.plugin.v3.StateBackendSpec - 10, // 4: cloudquery.plugin.v3.Sync.Response.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 10, // 4: cloudquery.plugin.v3.Sync.Response.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable 11, // 5: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert 12, // 6: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale 9, // 7: cloudquery.plugin.v3.Write.Request.options:type_name -> cloudquery.plugin.v3.WriteOptions - 10, // 8: cloudquery.plugin.v3.Write.Request.create_table:type_name -> cloudquery.plugin.v3.MessageCreateTable + 10, // 8: cloudquery.plugin.v3.Write.Request.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable 11, // 9: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert 12, // 10: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale 16, // 11: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request @@ -1859,7 +1857,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageCreateTable); i { + switch v := v.(*MessageMigrateTable); i { case 0: return &v.state case 1: @@ -2100,13 +2098,13 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { } } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].OneofWrappers = []interface{}{ - (*Sync_Response_CreateTable)(nil), + (*Sync_Response_MigrateTable)(nil), (*Sync_Response_Insert)(nil), (*Sync_Response_Delete)(nil), } file_plugin_pb_plugin_v3_plugin_proto_msgTypes[22].OneofWrappers = []interface{}{ (*Write_Request_Options)(nil), - (*Write_Request_CreateTable)(nil), + (*Write_Request_MigrateTable)(nil), (*Write_Request_Insert)(nil), (*Write_Request_Delete)(nil), } diff --git a/pb/plugin/v3/plugin_grpc.pb.go b/pb/plugin/v3/plugin_grpc.pb.go index e098f2c6..75431742 100644 --- a/pb/plugin/v3/plugin_grpc.pb.go +++ b/pb/plugin/v3/plugin_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/plugin/v3/plugin.proto @@ -18,6 +18,16 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Plugin_GetName_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetName" + Plugin_GetVersion_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetVersion" + Plugin_Init_FullMethodName = "/cloudquery.plugin.v3.Plugin/Init" + Plugin_GetTables_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetTables" + Plugin_Sync_FullMethodName = "/cloudquery.plugin.v3.Plugin/Sync" + Plugin_Write_FullMethodName = "/cloudquery.plugin.v3.Plugin/Write" + Plugin_Close_FullMethodName = "/cloudquery.plugin.v3.Plugin/Close" +) + // PluginClient is the client API for Plugin 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. @@ -48,7 +58,7 @@ func NewPluginClient(cc grpc.ClientConnInterface) PluginClient { func (c *pluginClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { out := new(GetName_Response) - err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Plugin_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -57,7 +67,7 @@ func (c *pluginClient) GetName(ctx context.Context, in *GetName_Request, opts .. func (c *pluginClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { out := new(GetVersion_Response) - err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Plugin_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -66,7 +76,7 @@ func (c *pluginClient) GetVersion(ctx context.Context, in *GetVersion_Request, o func (c *pluginClient) Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) { out := new(Init_Response) - err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Init", in, out, opts...) + err := c.cc.Invoke(ctx, Plugin_Init_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -75,7 +85,7 @@ func (c *pluginClient) Init(ctx context.Context, in *Init_Request, opts ...grpc. func (c *pluginClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { out := new(GetTables_Response) - err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetTables", in, out, opts...) + err := c.cc.Invoke(ctx, Plugin_GetTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -83,7 +93,7 @@ func (c *pluginClient) GetTables(ctx context.Context, in *GetTables_Request, opt } func (c *pluginClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Plugin_SyncClient, error) { - stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], "/cloudquery.plugin.v3.Plugin/Sync", opts...) + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], Plugin_Sync_FullMethodName, opts...) if err != nil { return nil, err } @@ -115,7 +125,7 @@ func (x *pluginSyncClient) Recv() (*Sync_Response, error) { } func (c *pluginClient) Write(ctx context.Context, opts ...grpc.CallOption) (Plugin_WriteClient, error) { - stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[1], "/cloudquery.plugin.v3.Plugin/Write", opts...) + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[1], Plugin_Write_FullMethodName, opts...) if err != nil { return nil, err } @@ -150,7 +160,7 @@ func (x *pluginWriteClient) CloseAndRecv() (*Write_Response, error) { func (c *pluginClient) Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) { out := new(Close_Response) - err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Close", in, out, opts...) + err := c.cc.Invoke(ctx, Plugin_Close_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -226,7 +236,7 @@ func _Plugin_GetName_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.plugin.v3.Plugin/GetName", + FullMethod: Plugin_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetName(ctx, req.(*GetName_Request)) @@ -244,7 +254,7 @@ func _Plugin_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.plugin.v3.Plugin/GetVersion", + FullMethod: Plugin_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetVersion(ctx, req.(*GetVersion_Request)) @@ -262,7 +272,7 @@ func _Plugin_Init_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.plugin.v3.Plugin/Init", + FullMethod: Plugin_Init_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).Init(ctx, req.(*Init_Request)) @@ -280,7 +290,7 @@ func _Plugin_GetTables_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.plugin.v3.Plugin/GetTables", + FullMethod: Plugin_GetTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetTables(ctx, req.(*GetTables_Request)) @@ -345,7 +355,7 @@ func _Plugin_Close_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.plugin.v3.Plugin/Close", + FullMethod: Plugin_Close_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).Close(ctx, req.(*Close_Request)) diff --git a/pb/source/v0/source_grpc.pb.go b/pb/source/v0/source_grpc.pb.go index abe32558..44a6e55a 100644 --- a/pb/source/v0/source_grpc.pb.go +++ b/pb/source/v0/source_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/source/v0/source.proto @@ -19,6 +19,18 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Source_GetProtocolVersion_FullMethodName = "/proto.Source/GetProtocolVersion" + Source_GetName_FullMethodName = "/proto.Source/GetName" + Source_GetVersion_FullMethodName = "/proto.Source/GetVersion" + Source_GetTables_FullMethodName = "/proto.Source/GetTables" + Source_GetTablesForSpec_FullMethodName = "/proto.Source/GetTablesForSpec" + Source_GetSyncSummary_FullMethodName = "/proto.Source/GetSyncSummary" + Source_Sync_FullMethodName = "/proto.Source/Sync" + Source_Sync2_FullMethodName = "/proto.Source/Sync2" + Source_GetMetrics_FullMethodName = "/proto.Source/GetMetrics" +) + // SourceClient is the client API for Source 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. @@ -58,7 +70,7 @@ func NewSourceClient(cc grpc.ClientConnInterface) SourceClient { func (c *sourceClient) GetProtocolVersion(ctx context.Context, in *v0.GetProtocolVersion_Request, opts ...grpc.CallOption) (*v0.GetProtocolVersion_Response, error) { out := new(v0.GetProtocolVersion_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetProtocolVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetProtocolVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -67,7 +79,7 @@ func (c *sourceClient) GetProtocolVersion(ctx context.Context, in *v0.GetProtoco func (c *sourceClient) GetName(ctx context.Context, in *v0.GetName_Request, opts ...grpc.CallOption) (*v0.GetName_Response, error) { out := new(v0.GetName_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +88,7 @@ func (c *sourceClient) GetName(ctx context.Context, in *v0.GetName_Request, opts func (c *sourceClient) GetVersion(ctx context.Context, in *v0.GetVersion_Request, opts ...grpc.CallOption) (*v0.GetVersion_Response, error) { out := new(v0.GetVersion_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -85,7 +97,7 @@ func (c *sourceClient) GetVersion(ctx context.Context, in *v0.GetVersion_Request func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { out := new(GetTables_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetTables", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -94,7 +106,7 @@ func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opt func (c *sourceClient) GetTablesForSpec(ctx context.Context, in *GetTablesForSpec_Request, opts ...grpc.CallOption) (*GetTablesForSpec_Response, error) { out := new(GetTablesForSpec_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetTablesForSpec", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetTablesForSpec_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -103,7 +115,7 @@ func (c *sourceClient) GetTablesForSpec(ctx context.Context, in *GetTablesForSpe func (c *sourceClient) GetSyncSummary(ctx context.Context, in *GetSyncSummary_Request, opts ...grpc.CallOption) (*GetSyncSummary_Response, error) { out := new(GetSyncSummary_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetSyncSummary", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetSyncSummary_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -111,7 +123,7 @@ func (c *sourceClient) GetSyncSummary(ctx context.Context, in *GetSyncSummary_Re } func (c *sourceClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Source_SyncClient, error) { - stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], "/proto.Source/Sync", opts...) + stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], Source_Sync_FullMethodName, opts...) if err != nil { return nil, err } @@ -143,7 +155,7 @@ func (x *sourceSyncClient) Recv() (*Sync_Response, error) { } func (c *sourceClient) Sync2(ctx context.Context, in *Sync2_Request, opts ...grpc.CallOption) (Source_Sync2Client, error) { - stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[1], "/proto.Source/Sync2", opts...) + stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[1], Source_Sync2_FullMethodName, opts...) if err != nil { return nil, err } @@ -176,7 +188,7 @@ func (x *sourceSync2Client) Recv() (*Sync2_Response, error) { func (c *sourceClient) GetMetrics(ctx context.Context, in *GetSourceMetrics_Request, opts ...grpc.CallOption) (*GetSourceMetrics_Response, error) { out := new(GetSourceMetrics_Response) - err := c.cc.Invoke(ctx, "/proto.Source/GetMetrics", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetMetrics_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -267,7 +279,7 @@ func _Source_GetProtocolVersion_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetProtocolVersion", + FullMethod: Source_GetProtocolVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetProtocolVersion(ctx, req.(*v0.GetProtocolVersion_Request)) @@ -285,7 +297,7 @@ func _Source_GetName_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetName", + FullMethod: Source_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetName(ctx, req.(*v0.GetName_Request)) @@ -303,7 +315,7 @@ func _Source_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetVersion", + FullMethod: Source_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetVersion(ctx, req.(*v0.GetVersion_Request)) @@ -321,7 +333,7 @@ func _Source_GetTables_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetTables", + FullMethod: Source_GetTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetTables(ctx, req.(*GetTables_Request)) @@ -339,7 +351,7 @@ func _Source_GetTablesForSpec_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetTablesForSpec", + FullMethod: Source_GetTablesForSpec_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetTablesForSpec(ctx, req.(*GetTablesForSpec_Request)) @@ -357,7 +369,7 @@ func _Source_GetSyncSummary_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetSyncSummary", + FullMethod: Source_GetSyncSummary_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetSyncSummary(ctx, req.(*GetSyncSummary_Request)) @@ -417,7 +429,7 @@ func _Source_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/proto.Source/GetMetrics", + FullMethod: Source_GetMetrics_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetMetrics(ctx, req.(*GetSourceMetrics_Request)) diff --git a/pb/source/v1/source_grpc.pb.go b/pb/source/v1/source_grpc.pb.go index 8f41a811..490d432e 100644 --- a/pb/source/v1/source_grpc.pb.go +++ b/pb/source/v1/source_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/source/v1/source.proto @@ -18,6 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Source_GetName_FullMethodName = "/cloudquery.source.v1.Source/GetName" + Source_GetVersion_FullMethodName = "/cloudquery.source.v1.Source/GetVersion" + Source_GetTables_FullMethodName = "/cloudquery.source.v1.Source/GetTables" + Source_GetMetrics_FullMethodName = "/cloudquery.source.v1.Source/GetMetrics" + Source_Init_FullMethodName = "/cloudquery.source.v1.Source/Init" + Source_GetDynamicTables_FullMethodName = "/cloudquery.source.v1.Source/GetDynamicTables" + Source_Sync_FullMethodName = "/cloudquery.source.v1.Source/Sync" + Source_GenDocs_FullMethodName = "/cloudquery.source.v1.Source/GenDocs" +) + // SourceClient is the client API for Source 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. @@ -50,7 +61,7 @@ func NewSourceClient(cc grpc.ClientConnInterface) SourceClient { func (c *sourceClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { out := new(GetName_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -59,7 +70,7 @@ func (c *sourceClient) GetName(ctx context.Context, in *GetName_Request, opts .. func (c *sourceClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { out := new(GetVersion_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -68,7 +79,7 @@ func (c *sourceClient) GetVersion(ctx context.Context, in *GetVersion_Request, o func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { out := new(GetTables_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GetTables", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,7 +88,7 @@ func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opt func (c *sourceClient) GetMetrics(ctx context.Context, in *GetMetrics_Request, opts ...grpc.CallOption) (*GetMetrics_Response, error) { out := new(GetMetrics_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GetMetrics", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetMetrics_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -86,7 +97,7 @@ func (c *sourceClient) GetMetrics(ctx context.Context, in *GetMetrics_Request, o func (c *sourceClient) Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) { out := new(Init_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/Init", in, out, opts...) + err := c.cc.Invoke(ctx, Source_Init_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -95,7 +106,7 @@ func (c *sourceClient) Init(ctx context.Context, in *Init_Request, opts ...grpc. func (c *sourceClient) GetDynamicTables(ctx context.Context, in *GetDynamicTables_Request, opts ...grpc.CallOption) (*GetDynamicTables_Response, error) { out := new(GetDynamicTables_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GetDynamicTables", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetDynamicTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -103,7 +114,7 @@ func (c *sourceClient) GetDynamicTables(ctx context.Context, in *GetDynamicTable } func (c *sourceClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Source_SyncClient, error) { - stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], "/cloudquery.source.v1.Source/Sync", opts...) + stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], Source_Sync_FullMethodName, opts...) if err != nil { return nil, err } @@ -136,7 +147,7 @@ func (x *sourceSyncClient) Recv() (*Sync_Response, error) { func (c *sourceClient) GenDocs(ctx context.Context, in *GenDocs_Request, opts ...grpc.CallOption) (*GenDocs_Response, error) { out := new(GenDocs_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v1.Source/GenDocs", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GenDocs_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -217,7 +228,7 @@ func _Source_GetName_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GetName", + FullMethod: Source_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetName(ctx, req.(*GetName_Request)) @@ -235,7 +246,7 @@ func _Source_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GetVersion", + FullMethod: Source_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetVersion(ctx, req.(*GetVersion_Request)) @@ -253,7 +264,7 @@ func _Source_GetTables_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GetTables", + FullMethod: Source_GetTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetTables(ctx, req.(*GetTables_Request)) @@ -271,7 +282,7 @@ func _Source_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GetMetrics", + FullMethod: Source_GetMetrics_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetMetrics(ctx, req.(*GetMetrics_Request)) @@ -289,7 +300,7 @@ func _Source_Init_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/Init", + FullMethod: Source_Init_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).Init(ctx, req.(*Init_Request)) @@ -307,7 +318,7 @@ func _Source_GetDynamicTables_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GetDynamicTables", + FullMethod: Source_GetDynamicTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetDynamicTables(ctx, req.(*GetDynamicTables_Request)) @@ -346,7 +357,7 @@ func _Source_GenDocs_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v1.Source/GenDocs", + FullMethod: Source_GenDocs_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GenDocs(ctx, req.(*GenDocs_Request)) diff --git a/pb/source/v2/source_grpc.pb.go b/pb/source/v2/source_grpc.pb.go index d60c4c39..e7a1e959 100644 --- a/pb/source/v2/source_grpc.pb.go +++ b/pb/source/v2/source_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: plugin-pb/source/v2/source.proto @@ -18,6 +18,17 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + Source_GetName_FullMethodName = "/cloudquery.source.v2.Source/GetName" + Source_GetVersion_FullMethodName = "/cloudquery.source.v2.Source/GetVersion" + Source_GetTables_FullMethodName = "/cloudquery.source.v2.Source/GetTables" + Source_GetMetrics_FullMethodName = "/cloudquery.source.v2.Source/GetMetrics" + Source_Init_FullMethodName = "/cloudquery.source.v2.Source/Init" + Source_GetDynamicTables_FullMethodName = "/cloudquery.source.v2.Source/GetDynamicTables" + Source_Sync_FullMethodName = "/cloudquery.source.v2.Source/Sync" + Source_GenDocs_FullMethodName = "/cloudquery.source.v2.Source/GenDocs" +) + // SourceClient is the client API for Source 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. @@ -50,7 +61,7 @@ func NewSourceClient(cc grpc.ClientConnInterface) SourceClient { func (c *sourceClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { out := new(GetName_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GetName", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetName_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -59,7 +70,7 @@ func (c *sourceClient) GetName(ctx context.Context, in *GetName_Request, opts .. func (c *sourceClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { out := new(GetVersion_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetVersion_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -68,7 +79,7 @@ func (c *sourceClient) GetVersion(ctx context.Context, in *GetVersion_Request, o func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { out := new(GetTables_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GetTables", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,7 +88,7 @@ func (c *sourceClient) GetTables(ctx context.Context, in *GetTables_Request, opt func (c *sourceClient) GetMetrics(ctx context.Context, in *GetMetrics_Request, opts ...grpc.CallOption) (*GetMetrics_Response, error) { out := new(GetMetrics_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GetMetrics", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetMetrics_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -86,7 +97,7 @@ func (c *sourceClient) GetMetrics(ctx context.Context, in *GetMetrics_Request, o func (c *sourceClient) Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) { out := new(Init_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/Init", in, out, opts...) + err := c.cc.Invoke(ctx, Source_Init_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -95,7 +106,7 @@ func (c *sourceClient) Init(ctx context.Context, in *Init_Request, opts ...grpc. func (c *sourceClient) GetDynamicTables(ctx context.Context, in *GetDynamicTables_Request, opts ...grpc.CallOption) (*GetDynamicTables_Response, error) { out := new(GetDynamicTables_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GetDynamicTables", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GetDynamicTables_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -103,7 +114,7 @@ func (c *sourceClient) GetDynamicTables(ctx context.Context, in *GetDynamicTable } func (c *sourceClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Source_SyncClient, error) { - stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], "/cloudquery.source.v2.Source/Sync", opts...) + stream, err := c.cc.NewStream(ctx, &Source_ServiceDesc.Streams[0], Source_Sync_FullMethodName, opts...) if err != nil { return nil, err } @@ -136,7 +147,7 @@ func (x *sourceSyncClient) Recv() (*Sync_Response, error) { func (c *sourceClient) GenDocs(ctx context.Context, in *GenDocs_Request, opts ...grpc.CallOption) (*GenDocs_Response, error) { out := new(GenDocs_Response) - err := c.cc.Invoke(ctx, "/cloudquery.source.v2.Source/GenDocs", in, out, opts...) + err := c.cc.Invoke(ctx, Source_GenDocs_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -217,7 +228,7 @@ func _Source_GetName_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GetName", + FullMethod: Source_GetName_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetName(ctx, req.(*GetName_Request)) @@ -235,7 +246,7 @@ func _Source_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GetVersion", + FullMethod: Source_GetVersion_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetVersion(ctx, req.(*GetVersion_Request)) @@ -253,7 +264,7 @@ func _Source_GetTables_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GetTables", + FullMethod: Source_GetTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetTables(ctx, req.(*GetTables_Request)) @@ -271,7 +282,7 @@ func _Source_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GetMetrics", + FullMethod: Source_GetMetrics_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetMetrics(ctx, req.(*GetMetrics_Request)) @@ -289,7 +300,7 @@ func _Source_Init_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/Init", + FullMethod: Source_Init_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).Init(ctx, req.(*Init_Request)) @@ -307,7 +318,7 @@ func _Source_GetDynamicTables_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GetDynamicTables", + FullMethod: Source_GetDynamicTables_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GetDynamicTables(ctx, req.(*GetDynamicTables_Request)) @@ -346,7 +357,7 @@ func _Source_GenDocs_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cloudquery.source.v2.Source/GenDocs", + FullMethod: Source_GenDocs_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(SourceServer).GenDocs(ctx, req.(*GenDocs_Request)) From b555c7ada854f48560e60f9f31bdd5e627a7b6f2 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Fri, 16 Jun 2023 22:57:03 +0300 Subject: [PATCH 4/6] fix registry unmarshal --- specs/v0/registry.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/specs/v0/registry.go b/specs/v0/registry.go index ddff0388..6fd3c470 100644 --- a/specs/v0/registry.go +++ b/specs/v0/registry.go @@ -1,6 +1,8 @@ package specs import ( + "bytes" + "encoding/json" "fmt" ) @@ -16,6 +18,24 @@ func (r Registry) String() string { return [...]string{"github", "local", "grpc"}[r] } +func (r Registry) MarshalJSON() ([]byte, error) { + buffer := bytes.NewBufferString(`"`) + buffer.WriteString(r.String()) + buffer.WriteString(`"`) + return buffer.Bytes(), nil +} + +func (r *Registry) UnmarshalJSON(data []byte) (err error) { + var registry string + if err := json.Unmarshal(data, ®istry); err != nil { + return err + } + if *r, err = RegistryFromString(registry); err != nil { + return err + } + return nil +} + func RegistryFromString(s string) (Registry, error) { switch s { case "github": From e3ac97072fcd8a5f3dac86977e181e59b9564db3 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Sun, 18 Jun 2023 16:00:18 +0300 Subject: [PATCH 5/6] more wip --- managedplugin/errors.go | 22 + managedplugin/plugin.go | 60 ++- pb/discovery/v1/discovery.pb.go | 6 +- pb/discovery/v1/discovery_grpc.pb.go | 10 +- pb/plugin/v3/plugin.pb.go | 427 ++++++---------- pb/plugin/v3/plugin_grpc.pb.go | 36 +- pb/specs/v1/spec.pb.go | 716 --------------------------- specs/v1/migrate_mode.go | 50 -- specs/v1/migrate_mode_test.go | 33 -- specs/v1/pk_mode.go | 50 -- specs/v1/pk_mode_test.go | 49 -- specs/v1/plugin.go | 97 ---- specs/v1/plugin_test.go | 270 ---------- specs/v1/registry.go | 49 -- specs/v1/registry_test.go | 36 -- specs/v1/scheduler.go | 60 --- specs/v1/scheduler_test.go | 36 -- specs/v1/spec.go | 100 ---- specs/v1/sync.go | 18 - specs/v1/write.go | 9 - specs/v1/write_mode.go | 53 -- specs/v1/write_mode_test.go | 33 -- 22 files changed, 253 insertions(+), 1967 deletions(-) create mode 100644 managedplugin/errors.go delete mode 100644 pb/specs/v1/spec.pb.go delete mode 100644 specs/v1/migrate_mode.go delete mode 100644 specs/v1/migrate_mode_test.go delete mode 100644 specs/v1/pk_mode.go delete mode 100644 specs/v1/pk_mode_test.go delete mode 100644 specs/v1/plugin.go delete mode 100644 specs/v1/plugin_test.go delete mode 100644 specs/v1/registry.go delete mode 100644 specs/v1/registry_test.go delete mode 100644 specs/v1/scheduler.go delete mode 100644 specs/v1/scheduler_test.go delete mode 100644 specs/v1/spec.go delete mode 100644 specs/v1/sync.go delete mode 100644 specs/v1/write.go delete mode 100644 specs/v1/write_mode.go delete mode 100644 specs/v1/write_mode_test.go diff --git a/managedplugin/errors.go b/managedplugin/errors.go new file mode 100644 index 00000000..a2c3caf4 --- /dev/null +++ b/managedplugin/errors.go @@ -0,0 +1,22 @@ +package managedplugin + +import ( + "errors" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// isUnimplemented returns true if an error indicates that the underlying grpc call +// was unimplemented on the server side. +func isUnimplemented(err error) bool { + if err == nil { + return false + } + st, ok := status.FromError(err) + if ok && st.Code() == codes.Unimplemented { + return true + } + err = errors.Unwrap(err) + return isUnimplemented(err) +} \ No newline at end of file diff --git a/managedplugin/plugin.go b/managedplugin/plugin.go index f4f35487..b7e55184 100644 --- a/managedplugin/plugin.go +++ b/managedplugin/plugin.go @@ -10,11 +10,13 @@ import ( "os" "os/exec" "path/filepath" + "strconv" "strings" "sync" pbBase "github.com/cloudquery/plugin-pb-go/pb/base/v0" pbDiscovery "github.com/cloudquery/plugin-pb-go/pb/discovery/v0" + pbDiscoveryV1 "github.com/cloudquery/plugin-pb-go/pb/discovery/v1" pbSource "github.com/cloudquery/plugin-pb-go/pb/source/v0" "github.com/rs/zerolog" "golang.org/x/exp/slices" @@ -134,7 +136,7 @@ func NewClient(ctx context.Context, config Config, opts ...Option) (*Client, err return nil, fmt.Errorf("invalid github plugin path: %s. format should be owner/repo", config.Path) } org, name := pathSplit[0], pathSplit[1] - c.LocalPath = filepath.Join(c.directory, "plugins", "plugin", org, name, config.Version, "plugin") + c.LocalPath = filepath.Join(c.directory, "plugins", "github.com", org, name, config.Version, "plugin") c.LocalPath = WithBinarySuffix(c.LocalPath) if err := DownloadPluginFromGithub(ctx, c.LocalPath, org, name, config.Version); err != nil { return nil, err @@ -215,6 +217,62 @@ func (c *Client) startLocal(ctx context.Context, path string) error { return nil } +func (c *Client) Name() string { + return c.config.Name +} + +func (c *Client) oldDiscovery(ctx context.Context) ([]int, error) { + discoveryClient := pbDiscovery.NewDiscoveryClient(c.Conn) + versionsRes, err := discoveryClient.GetVersions(ctx, &pbDiscovery.GetVersions_Request{}) + if err != nil { + if isUnimplemented(err) { + // If we get an error here, we assume that the plugin is not a v1 plugin and we try to sync it as a v0 plugin + // this is for backward compatibility where we used incorrect versioning mechanism + oldDiscoveryClient := pbSource.NewSourceClient(c.Conn) + versionRes, err := oldDiscoveryClient.GetProtocolVersion(ctx, &pbBase.GetProtocolVersion_Request{}) + if err != nil { + return nil, err + } + switch versionRes.Version { + case 2: + return []int{0}, nil + case 1: + return []int{-1}, nil + default: + return nil, fmt.Errorf("unknown protocol version %d", versionRes.Version) + } + } + return nil, err + } + versions := make([]int, len(versionsRes.Versions)) + for i, vStr := range versionsRes.Versions { + vStr = strings.TrimPrefix(vStr, "v") + v, err := strconv.ParseInt(vStr, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse version %s: %w", vStr, err) + } + versions[i] = int(v) + } + return versions, nil +} + +func (c *Client) Versions(ctx context.Context) ([]int, error) { + discoveryClient := pbDiscoveryV1.NewDiscoveryClient(c.Conn) + versionsRes, err := discoveryClient.GetVersions(ctx, &pbDiscoveryV1.GetVersions_Request{}) + if err != nil { + if isUnimplemented(err) { + // this was only added post v3 so clients will fallback to using an older discovery service + return c.oldDiscovery(ctx) + } + return nil, err + } + res := make([]int, len(versionsRes.Versions)) + for i, v := range versionsRes.Versions { + res[i] = int(v) + } + return res, nil +} + func (c *Client) MaxVersion(ctx context.Context) (int, error) { discoveryClient := pbDiscovery.NewDiscoveryClient(c.Conn) versionsRes, err := discoveryClient.GetVersions(ctx, &pbDiscovery.GetVersions_Request{}) diff --git a/pb/discovery/v1/discovery.pb.go b/pb/discovery/v1/discovery.pb.go index c45c07d0..08743aeb 100644 --- a/pb/discovery/v1/discovery.pb.go +++ b/pb/discovery/v1/discovery.pb.go @@ -101,7 +101,7 @@ type GetVersions_Response struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Versions []uint64 `protobuf:"varint,1,rep,packed,name=versions,proto3" json:"versions,omitempty"` + Versions []int32 `protobuf:"varint,1,rep,packed,name=versions,proto3" json:"versions,omitempty"` } func (x *GetVersions_Response) Reset() { @@ -136,7 +136,7 @@ func (*GetVersions_Response) Descriptor() ([]byte, []int) { return file_plugin_pb_discovery_v1_discovery_proto_rawDescGZIP(), []int{0, 1} } -func (x *GetVersions_Response) GetVersions() []uint64 { +func (x *GetVersions_Response) GetVersions() []int32 { if x != nil { return x.Versions } @@ -153,7 +153,7 @@ var file_plugin_pb_discovery_v1_discovery_proto_rawDesc = []byte{ 0x31, 0x22, 0x40, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x32, 0x77, 0x0a, 0x09, 0x44, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x12, 0x6a, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x64, 0x69, 0x73, diff --git a/pb/discovery/v1/discovery_grpc.pb.go b/pb/discovery/v1/discovery_grpc.pb.go index 9d0c4c4b..ee73dafe 100644 --- a/pb/discovery/v1/discovery_grpc.pb.go +++ b/pb/discovery/v1/discovery_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v3.21.12 // source: plugin-pb/discovery/v1/discovery.proto @@ -18,10 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Discovery_GetVersions_FullMethodName = "/cloudquery.discovery.v1.Discovery/GetVersions" -) - // DiscoveryClient is the client API for Discovery 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. @@ -40,7 +36,7 @@ func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient { func (c *discoveryClient) GetVersions(ctx context.Context, in *GetVersions_Request, opts ...grpc.CallOption) (*GetVersions_Response, error) { out := new(GetVersions_Response) - err := c.cc.Invoke(ctx, Discovery_GetVersions_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.discovery.v1.Discovery/GetVersions", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +82,7 @@ func _Discovery_GetVersions_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Discovery_GetVersions_FullMethodName, + FullMethod: "/cloudquery.discovery.v1.Discovery/GetVersions", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DiscoveryServer).GetVersions(ctx, req.(*GetVersions_Request)) diff --git a/pb/plugin/v3/plugin.pb.go b/pb/plugin/v3/plugin.pb.go index 95a53576..bc2a66b5 100644 --- a/pb/plugin/v3/plugin.pb.go +++ b/pb/plugin/v3/plugin.pb.go @@ -70,98 +70,6 @@ func (REGISTRY) EnumDescriptor() ([]byte, []int) { return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{0} } -type SCHEDULER int32 - -const ( - SCHEDULER_SCHEDULER_DFS SCHEDULER = 0 - SCHEDULER_SCHEDULER_ROUND_ROBIN SCHEDULER = 1 -) - -// Enum value maps for SCHEDULER. -var ( - SCHEDULER_name = map[int32]string{ - 0: "SCHEDULER_DFS", - 1: "SCHEDULER_ROUND_ROBIN", - } - SCHEDULER_value = map[string]int32{ - "SCHEDULER_DFS": 0, - "SCHEDULER_ROUND_ROBIN": 1, - } -) - -func (x SCHEDULER) Enum() *SCHEDULER { - p := new(SCHEDULER) - *p = x - return p -} - -func (x SCHEDULER) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SCHEDULER) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1].Descriptor() -} - -func (SCHEDULER) Type() protoreflect.EnumType { - return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1] -} - -func (x SCHEDULER) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SCHEDULER.Descriptor instead. -func (SCHEDULER) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1} -} - -type Operator int32 - -const ( - Operator_EQUAL Operator = 0 - Operator_LESS_THAN Operator = 1 -) - -// Enum value maps for Operator. -var ( - Operator_name = map[int32]string{ - 0: "EQUAL", - 1: "LESS_THAN", - } - Operator_value = map[string]int32{ - "EQUAL": 0, - "LESS_THAN": 1, - } -) - -func (x Operator) Enum() *Operator { - p := new(Operator) - *p = x - return p -} - -func (x Operator) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Operator) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[2].Descriptor() -} - -func (Operator) Type() protoreflect.EnumType { - return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[2] -} - -func (x Operator) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Operator.Descriptor instead. -func (Operator) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{2} -} - type PK_MODE int32 const ( @@ -192,11 +100,11 @@ func (x PK_MODE) String() string { } func (PK_MODE) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[3].Descriptor() + return file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1].Descriptor() } func (PK_MODE) Type() protoreflect.EnumType { - return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[3] + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1] } func (x PK_MODE) Number() protoreflect.EnumNumber { @@ -205,7 +113,7 @@ func (x PK_MODE) Number() protoreflect.EnumNumber { // Deprecated: Use PK_MODE.Descriptor instead. func (PK_MODE) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{3} + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{1} } type StateBackendSpec struct { @@ -1141,8 +1049,6 @@ type Sync_Request struct { Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` SkipTables []string `protobuf:"bytes,2,rep,name=skip_tables,json=skipTables,proto3" json:"skip_tables,omitempty"` - Concurrency int64 `protobuf:"varint,3,opt,name=concurrency,proto3" json:"concurrency,omitempty"` - Scheduler SCHEDULER `protobuf:"varint,4,opt,name=scheduler,proto3,enum=cloudquery.plugin.v3.SCHEDULER" json:"scheduler,omitempty"` StateBackend *StateBackendSpec `protobuf:"bytes,5,opt,name=state_backend,json=stateBackend,proto3" json:"state_backend,omitempty"` } @@ -1192,20 +1098,6 @@ func (x *Sync_Request) GetSkipTables() []string { return nil } -func (x *Sync_Request) GetConcurrency() int64 { - if x != nil { - return x.Concurrency - } - return 0 -} - -func (x *Sync_Request) GetScheduler() SCHEDULER { - if x != nil { - return x.Scheduler - } - return SCHEDULER_SCHEDULER_DFS -} - func (x *Sync_Request) GetStateBackend() *StateBackendSpec { if x != nil { return x.StateBackend @@ -1219,6 +1111,7 @@ type Sync_Response struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Message: + // // *Sync_Response_MigrateTable // *Sync_Response_Insert // *Sync_Response_Delete @@ -1313,6 +1206,7 @@ type Write_Request struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Message: + // // *Write_Request_Options // *Write_Request_MigrateTable // *Write_Request_Insert @@ -1586,116 +1480,104 @@ var file_plugin_pb_plugin_v3_plugin_proto_rawDesc = []byte{ 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe6, 0x03, 0x0a, - 0x04, 0x53, 0x79, 0x6e, 0x63, 0x1a, 0xf0, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x6d, 0x70, 0x52, 0x08, 0x73, 0x79, 0x6e, 0x63, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x85, 0x03, 0x0a, + 0x04, 0x53, 0x79, 0x6e, 0x63, 0x1a, 0x8f, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, - 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, - 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3d, 0x0a, 0x09, - 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, - 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0d, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0xea, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, - 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, - 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0d, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x42, 0x61, + 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x1a, 0xea, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, + 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, - 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, - 0xa9, 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x48, 0x00, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x0d, 0x6d, - 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, - 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, - 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, - 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, + 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x1a, 0xa9, + 0x02, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3e, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, + 0x00, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x50, 0x0a, 0x0d, 0x6d, 0x69, + 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x4d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x0c, + 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x3d, 0x0a, 0x06, + 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, - 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, - 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x47, 0x49, - 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x52, - 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x2a, - 0x39, 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, - 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, - 0x19, 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, - 0x4e, 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x2a, 0x24, 0x0a, 0x08, 0x4f, 0x70, - 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x10, - 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, - 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, - 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x32, 0xf3, 0x04, 0x0a, 0x06, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, - 0x0a, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x63, 0x6c, + 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x73, 0x65, 0x72, + 0x74, 0x48, 0x00, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x12, 0x42, 0x0a, 0x06, 0x64, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, - 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4f, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, - 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, + 0x76, 0x33, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x53, 0x74, 0x61, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, + 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x1a, + 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, + 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, + 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, 0x47, 0x49, 0x53, + 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x52, 0x45, + 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, 0x02, 0x2a, 0x26, + 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, + 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, + 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x32, 0xf3, 0x04, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, + 0x6e, 0x12, 0x58, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x25, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x27, - 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x51, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, + 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x47, + 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, - 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x54, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x05, 0x43, 0x6c, - 0x6f, 0x73, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, - 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, - 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, - 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, - 0x62, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, - 0x33, 0x3b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, + 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x49, 0x6e, + 0x69, 0x74, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, + 0x33, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x12, 0x27, 0x2e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x47, 0x65, 0x74, + 0x54, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x51, 0x0a, 0x04, 0x53, 0x79, 0x6e, 0x63, 0x12, 0x22, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x53, + 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x30, 0x01, 0x12, 0x54, 0x0a, 0x05, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, + 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, + 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, + 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x52, 0x0a, 0x05, 0x43, 0x6c, 0x6f, 0x73, + 0x65, 0x12, 0x23, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, + 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x6c, + 0x6f, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x38, 0x5a, 0x36, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, + 0x67, 0x6f, 0x2f, 0x70, 0x62, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, 0x33, 0x3b, + 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1710,72 +1592,69 @@ func file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP() []byte { return file_plugin_pb_plugin_v3_plugin_proto_rawDescData } -var file_plugin_pb_plugin_v3_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_plugin_pb_plugin_v3_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_plugin_pb_plugin_v3_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_plugin_pb_plugin_v3_plugin_proto_goTypes = []interface{}{ (REGISTRY)(0), // 0: cloudquery.plugin.v3.REGISTRY - (SCHEDULER)(0), // 1: cloudquery.plugin.v3.SCHEDULER - (Operator)(0), // 2: cloudquery.plugin.v3.Operator - (PK_MODE)(0), // 3: cloudquery.plugin.v3.PK_MODE - (*StateBackendSpec)(nil), // 4: cloudquery.plugin.v3.StateBackendSpec - (*GetName)(nil), // 5: cloudquery.plugin.v3.GetName - (*GetVersion)(nil), // 6: cloudquery.plugin.v3.GetVersion - (*Init)(nil), // 7: cloudquery.plugin.v3.Init - (*GetTables)(nil), // 8: cloudquery.plugin.v3.GetTables - (*WriteOptions)(nil), // 9: cloudquery.plugin.v3.WriteOptions - (*MessageMigrateTable)(nil), // 10: cloudquery.plugin.v3.MessageMigrateTable - (*MessageInsert)(nil), // 11: cloudquery.plugin.v3.MessageInsert - (*MessageDeleteStale)(nil), // 12: cloudquery.plugin.v3.MessageDeleteStale - (*Sync)(nil), // 13: cloudquery.plugin.v3.Sync - (*Write)(nil), // 14: cloudquery.plugin.v3.Write - (*Close)(nil), // 15: cloudquery.plugin.v3.Close - (*GetName_Request)(nil), // 16: cloudquery.plugin.v3.GetName.Request - (*GetName_Response)(nil), // 17: cloudquery.plugin.v3.GetName.Response - (*GetVersion_Request)(nil), // 18: cloudquery.plugin.v3.GetVersion.Request - (*GetVersion_Response)(nil), // 19: cloudquery.plugin.v3.GetVersion.Response - (*Init_Request)(nil), // 20: cloudquery.plugin.v3.Init.Request - (*Init_Response)(nil), // 21: cloudquery.plugin.v3.Init.Response - (*GetTables_Request)(nil), // 22: cloudquery.plugin.v3.GetTables.Request - (*GetTables_Response)(nil), // 23: cloudquery.plugin.v3.GetTables.Response - (*Sync_Request)(nil), // 24: cloudquery.plugin.v3.Sync.Request - (*Sync_Response)(nil), // 25: cloudquery.plugin.v3.Sync.Response - (*Write_Request)(nil), // 26: cloudquery.plugin.v3.Write.Request - (*Write_Response)(nil), // 27: cloudquery.plugin.v3.Write.Response - (*Close_Request)(nil), // 28: cloudquery.plugin.v3.Close.Request - (*Close_Response)(nil), // 29: cloudquery.plugin.v3.Close.Response - (*timestamppb.Timestamp)(nil), // 30: google.protobuf.Timestamp + (PK_MODE)(0), // 1: cloudquery.plugin.v3.PK_MODE + (*StateBackendSpec)(nil), // 2: cloudquery.plugin.v3.StateBackendSpec + (*GetName)(nil), // 3: cloudquery.plugin.v3.GetName + (*GetVersion)(nil), // 4: cloudquery.plugin.v3.GetVersion + (*Init)(nil), // 5: cloudquery.plugin.v3.Init + (*GetTables)(nil), // 6: cloudquery.plugin.v3.GetTables + (*WriteOptions)(nil), // 7: cloudquery.plugin.v3.WriteOptions + (*MessageMigrateTable)(nil), // 8: cloudquery.plugin.v3.MessageMigrateTable + (*MessageInsert)(nil), // 9: cloudquery.plugin.v3.MessageInsert + (*MessageDeleteStale)(nil), // 10: cloudquery.plugin.v3.MessageDeleteStale + (*Sync)(nil), // 11: cloudquery.plugin.v3.Sync + (*Write)(nil), // 12: cloudquery.plugin.v3.Write + (*Close)(nil), // 13: cloudquery.plugin.v3.Close + (*GetName_Request)(nil), // 14: cloudquery.plugin.v3.GetName.Request + (*GetName_Response)(nil), // 15: cloudquery.plugin.v3.GetName.Response + (*GetVersion_Request)(nil), // 16: cloudquery.plugin.v3.GetVersion.Request + (*GetVersion_Response)(nil), // 17: cloudquery.plugin.v3.GetVersion.Response + (*Init_Request)(nil), // 18: cloudquery.plugin.v3.Init.Request + (*Init_Response)(nil), // 19: cloudquery.plugin.v3.Init.Response + (*GetTables_Request)(nil), // 20: cloudquery.plugin.v3.GetTables.Request + (*GetTables_Response)(nil), // 21: cloudquery.plugin.v3.GetTables.Response + (*Sync_Request)(nil), // 22: cloudquery.plugin.v3.Sync.Request + (*Sync_Response)(nil), // 23: cloudquery.plugin.v3.Sync.Response + (*Write_Request)(nil), // 24: cloudquery.plugin.v3.Write.Request + (*Write_Response)(nil), // 25: cloudquery.plugin.v3.Write.Response + (*Close_Request)(nil), // 26: cloudquery.plugin.v3.Close.Request + (*Close_Response)(nil), // 27: cloudquery.plugin.v3.Close.Response + (*timestamppb.Timestamp)(nil), // 28: google.protobuf.Timestamp } var file_plugin_pb_plugin_v3_plugin_proto_depIdxs = []int32{ 0, // 0: cloudquery.plugin.v3.StateBackendSpec.registry:type_name -> cloudquery.plugin.v3.REGISTRY - 30, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp - 1, // 2: cloudquery.plugin.v3.Sync.Request.scheduler:type_name -> cloudquery.plugin.v3.SCHEDULER - 4, // 3: cloudquery.plugin.v3.Sync.Request.state_backend:type_name -> cloudquery.plugin.v3.StateBackendSpec - 10, // 4: cloudquery.plugin.v3.Sync.Response.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable - 11, // 5: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert - 12, // 6: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale - 9, // 7: cloudquery.plugin.v3.Write.Request.options:type_name -> cloudquery.plugin.v3.WriteOptions - 10, // 8: cloudquery.plugin.v3.Write.Request.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable - 11, // 9: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert - 12, // 10: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale - 16, // 11: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request - 18, // 12: cloudquery.plugin.v3.Plugin.GetVersion:input_type -> cloudquery.plugin.v3.GetVersion.Request - 20, // 13: cloudquery.plugin.v3.Plugin.Init:input_type -> cloudquery.plugin.v3.Init.Request - 22, // 14: cloudquery.plugin.v3.Plugin.GetTables:input_type -> cloudquery.plugin.v3.GetTables.Request - 24, // 15: cloudquery.plugin.v3.Plugin.Sync:input_type -> cloudquery.plugin.v3.Sync.Request - 26, // 16: cloudquery.plugin.v3.Plugin.Write:input_type -> cloudquery.plugin.v3.Write.Request - 28, // 17: cloudquery.plugin.v3.Plugin.Close:input_type -> cloudquery.plugin.v3.Close.Request - 17, // 18: cloudquery.plugin.v3.Plugin.GetName:output_type -> cloudquery.plugin.v3.GetName.Response - 19, // 19: cloudquery.plugin.v3.Plugin.GetVersion:output_type -> cloudquery.plugin.v3.GetVersion.Response - 21, // 20: cloudquery.plugin.v3.Plugin.Init:output_type -> cloudquery.plugin.v3.Init.Response - 23, // 21: cloudquery.plugin.v3.Plugin.GetTables:output_type -> cloudquery.plugin.v3.GetTables.Response - 25, // 22: cloudquery.plugin.v3.Plugin.Sync:output_type -> cloudquery.plugin.v3.Sync.Response - 27, // 23: cloudquery.plugin.v3.Plugin.Write:output_type -> cloudquery.plugin.v3.Write.Response - 29, // 24: cloudquery.plugin.v3.Plugin.Close:output_type -> cloudquery.plugin.v3.Close.Response - 18, // [18:25] is the sub-list for method output_type - 11, // [11:18] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 28, // 1: cloudquery.plugin.v3.MessageDeleteStale.sync_time:type_name -> google.protobuf.Timestamp + 2, // 2: cloudquery.plugin.v3.Sync.Request.state_backend:type_name -> cloudquery.plugin.v3.StateBackendSpec + 8, // 3: cloudquery.plugin.v3.Sync.Response.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable + 9, // 4: cloudquery.plugin.v3.Sync.Response.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 10, // 5: cloudquery.plugin.v3.Sync.Response.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 7, // 6: cloudquery.plugin.v3.Write.Request.options:type_name -> cloudquery.plugin.v3.WriteOptions + 8, // 7: cloudquery.plugin.v3.Write.Request.migrate_table:type_name -> cloudquery.plugin.v3.MessageMigrateTable + 9, // 8: cloudquery.plugin.v3.Write.Request.insert:type_name -> cloudquery.plugin.v3.MessageInsert + 10, // 9: cloudquery.plugin.v3.Write.Request.delete:type_name -> cloudquery.plugin.v3.MessageDeleteStale + 14, // 10: cloudquery.plugin.v3.Plugin.GetName:input_type -> cloudquery.plugin.v3.GetName.Request + 16, // 11: cloudquery.plugin.v3.Plugin.GetVersion:input_type -> cloudquery.plugin.v3.GetVersion.Request + 18, // 12: cloudquery.plugin.v3.Plugin.Init:input_type -> cloudquery.plugin.v3.Init.Request + 20, // 13: cloudquery.plugin.v3.Plugin.GetTables:input_type -> cloudquery.plugin.v3.GetTables.Request + 22, // 14: cloudquery.plugin.v3.Plugin.Sync:input_type -> cloudquery.plugin.v3.Sync.Request + 24, // 15: cloudquery.plugin.v3.Plugin.Write:input_type -> cloudquery.plugin.v3.Write.Request + 26, // 16: cloudquery.plugin.v3.Plugin.Close:input_type -> cloudquery.plugin.v3.Close.Request + 15, // 17: cloudquery.plugin.v3.Plugin.GetName:output_type -> cloudquery.plugin.v3.GetName.Response + 17, // 18: cloudquery.plugin.v3.Plugin.GetVersion:output_type -> cloudquery.plugin.v3.GetVersion.Response + 19, // 19: cloudquery.plugin.v3.Plugin.Init:output_type -> cloudquery.plugin.v3.Init.Response + 21, // 20: cloudquery.plugin.v3.Plugin.GetTables:output_type -> cloudquery.plugin.v3.GetTables.Response + 23, // 21: cloudquery.plugin.v3.Plugin.Sync:output_type -> cloudquery.plugin.v3.Sync.Response + 25, // 22: cloudquery.plugin.v3.Plugin.Write:output_type -> cloudquery.plugin.v3.Write.Response + 27, // 23: cloudquery.plugin.v3.Plugin.Close:output_type -> cloudquery.plugin.v3.Close.Response + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_plugin_pb_plugin_v3_plugin_proto_init() } @@ -2113,7 +1992,7 @@ func file_plugin_pb_plugin_v3_plugin_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_plugin_pb_plugin_v3_plugin_proto_rawDesc, - NumEnums: 4, + NumEnums: 2, NumMessages: 26, NumExtensions: 0, NumServices: 1, diff --git a/pb/plugin/v3/plugin_grpc.pb.go b/pb/plugin/v3/plugin_grpc.pb.go index 75431742..e098f2c6 100644 --- a/pb/plugin/v3/plugin_grpc.pb.go +++ b/pb/plugin/v3/plugin_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.2.0 // - protoc v3.21.12 // source: plugin-pb/plugin/v3/plugin.proto @@ -18,16 +18,6 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -const ( - Plugin_GetName_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetName" - Plugin_GetVersion_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetVersion" - Plugin_Init_FullMethodName = "/cloudquery.plugin.v3.Plugin/Init" - Plugin_GetTables_FullMethodName = "/cloudquery.plugin.v3.Plugin/GetTables" - Plugin_Sync_FullMethodName = "/cloudquery.plugin.v3.Plugin/Sync" - Plugin_Write_FullMethodName = "/cloudquery.plugin.v3.Plugin/Write" - Plugin_Close_FullMethodName = "/cloudquery.plugin.v3.Plugin/Close" -) - // PluginClient is the client API for Plugin 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. @@ -58,7 +48,7 @@ func NewPluginClient(cc grpc.ClientConnInterface) PluginClient { func (c *pluginClient) GetName(ctx context.Context, in *GetName_Request, opts ...grpc.CallOption) (*GetName_Response, error) { out := new(GetName_Response) - err := c.cc.Invoke(ctx, Plugin_GetName_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetName", in, out, opts...) if err != nil { return nil, err } @@ -67,7 +57,7 @@ func (c *pluginClient) GetName(ctx context.Context, in *GetName_Request, opts .. func (c *pluginClient) GetVersion(ctx context.Context, in *GetVersion_Request, opts ...grpc.CallOption) (*GetVersion_Response, error) { out := new(GetVersion_Response) - err := c.cc.Invoke(ctx, Plugin_GetVersion_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetVersion", in, out, opts...) if err != nil { return nil, err } @@ -76,7 +66,7 @@ func (c *pluginClient) GetVersion(ctx context.Context, in *GetVersion_Request, o func (c *pluginClient) Init(ctx context.Context, in *Init_Request, opts ...grpc.CallOption) (*Init_Response, error) { out := new(Init_Response) - err := c.cc.Invoke(ctx, Plugin_Init_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Init", in, out, opts...) if err != nil { return nil, err } @@ -85,7 +75,7 @@ func (c *pluginClient) Init(ctx context.Context, in *Init_Request, opts ...grpc. func (c *pluginClient) GetTables(ctx context.Context, in *GetTables_Request, opts ...grpc.CallOption) (*GetTables_Response, error) { out := new(GetTables_Response) - err := c.cc.Invoke(ctx, Plugin_GetTables_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/GetTables", in, out, opts...) if err != nil { return nil, err } @@ -93,7 +83,7 @@ func (c *pluginClient) GetTables(ctx context.Context, in *GetTables_Request, opt } func (c *pluginClient) Sync(ctx context.Context, in *Sync_Request, opts ...grpc.CallOption) (Plugin_SyncClient, error) { - stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], Plugin_Sync_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[0], "/cloudquery.plugin.v3.Plugin/Sync", opts...) if err != nil { return nil, err } @@ -125,7 +115,7 @@ func (x *pluginSyncClient) Recv() (*Sync_Response, error) { } func (c *pluginClient) Write(ctx context.Context, opts ...grpc.CallOption) (Plugin_WriteClient, error) { - stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[1], Plugin_Write_FullMethodName, opts...) + stream, err := c.cc.NewStream(ctx, &Plugin_ServiceDesc.Streams[1], "/cloudquery.plugin.v3.Plugin/Write", opts...) if err != nil { return nil, err } @@ -160,7 +150,7 @@ func (x *pluginWriteClient) CloseAndRecv() (*Write_Response, error) { func (c *pluginClient) Close(ctx context.Context, in *Close_Request, opts ...grpc.CallOption) (*Close_Response, error) { out := new(Close_Response) - err := c.cc.Invoke(ctx, Plugin_Close_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, "/cloudquery.plugin.v3.Plugin/Close", in, out, opts...) if err != nil { return nil, err } @@ -236,7 +226,7 @@ func _Plugin_GetName_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Plugin_GetName_FullMethodName, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetName", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetName(ctx, req.(*GetName_Request)) @@ -254,7 +244,7 @@ func _Plugin_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(i } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Plugin_GetVersion_FullMethodName, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetVersion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetVersion(ctx, req.(*GetVersion_Request)) @@ -272,7 +262,7 @@ func _Plugin_Init_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Plugin_Init_FullMethodName, + FullMethod: "/cloudquery.plugin.v3.Plugin/Init", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).Init(ctx, req.(*Init_Request)) @@ -290,7 +280,7 @@ func _Plugin_GetTables_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Plugin_GetTables_FullMethodName, + FullMethod: "/cloudquery.plugin.v3.Plugin/GetTables", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).GetTables(ctx, req.(*GetTables_Request)) @@ -355,7 +345,7 @@ func _Plugin_Close_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: Plugin_Close_FullMethodName, + FullMethod: "/cloudquery.plugin.v3.Plugin/Close", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PluginServer).Close(ctx, req.(*Close_Request)) diff --git a/pb/specs/v1/spec.pb.go b/pb/specs/v1/spec.pb.go deleted file mode 100644 index a4ccaa92..00000000 --- a/pb/specs/v1/spec.pb.go +++ /dev/null @@ -1,716 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.12 -// source: plugin-pb/specs/v1/spec.proto - -package specs - -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 WRITE_MODE int32 - -const ( - WRITE_MODE_WRITE_MODE_OVERWRITE_DELETE_STALE WRITE_MODE = 0 - WRITE_MODE_WRITE_MODE_OVERWRITE WRITE_MODE = 1 - WRITE_MODE_WRITE_MODE_APPEND WRITE_MODE = 2 -) - -// Enum value maps for WRITE_MODE. -var ( - WRITE_MODE_name = map[int32]string{ - 0: "WRITE_MODE_OVERWRITE_DELETE_STALE", - 1: "WRITE_MODE_OVERWRITE", - 2: "WRITE_MODE_APPEND", - } - WRITE_MODE_value = map[string]int32{ - "WRITE_MODE_OVERWRITE_DELETE_STALE": 0, - "WRITE_MODE_OVERWRITE": 1, - "WRITE_MODE_APPEND": 2, - } -) - -func (x WRITE_MODE) Enum() *WRITE_MODE { - p := new(WRITE_MODE) - *p = x - return p -} - -func (x WRITE_MODE) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WRITE_MODE) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_specs_v1_spec_proto_enumTypes[0].Descriptor() -} - -func (WRITE_MODE) Type() protoreflect.EnumType { - return &file_plugin_pb_specs_v1_spec_proto_enumTypes[0] -} - -func (x WRITE_MODE) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WRITE_MODE.Descriptor instead. -func (WRITE_MODE) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{0} -} - -type REGISTRY int32 - -const ( - REGISTRY_REGISTRY_GITHUB REGISTRY = 0 - REGISTRY_REGISTRY_GRPC REGISTRY = 1 - REGISTRY_REGISTRY_LOCAL REGISTRY = 2 -) - -// Enum value maps for REGISTRY. -var ( - REGISTRY_name = map[int32]string{ - 0: "REGISTRY_GITHUB", - 1: "REGISTRY_GRPC", - 2: "REGISTRY_LOCAL", - } - REGISTRY_value = map[string]int32{ - "REGISTRY_GITHUB": 0, - "REGISTRY_GRPC": 1, - "REGISTRY_LOCAL": 2, - } -) - -func (x REGISTRY) Enum() *REGISTRY { - p := new(REGISTRY) - *p = x - return p -} - -func (x REGISTRY) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (REGISTRY) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_specs_v1_spec_proto_enumTypes[1].Descriptor() -} - -func (REGISTRY) Type() protoreflect.EnumType { - return &file_plugin_pb_specs_v1_spec_proto_enumTypes[1] -} - -func (x REGISTRY) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use REGISTRY.Descriptor instead. -func (REGISTRY) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{1} -} - -type MIGRATE_MODE int32 - -const ( - MIGRATE_MODE_SAFE MIGRATE_MODE = 0 - MIGRATE_MODE_FORCE MIGRATE_MODE = 1 -) - -// Enum value maps for MIGRATE_MODE. -var ( - MIGRATE_MODE_name = map[int32]string{ - 0: "SAFE", - 1: "FORCE", - } - MIGRATE_MODE_value = map[string]int32{ - "SAFE": 0, - "FORCE": 1, - } -) - -func (x MIGRATE_MODE) Enum() *MIGRATE_MODE { - p := new(MIGRATE_MODE) - *p = x - return p -} - -func (x MIGRATE_MODE) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MIGRATE_MODE) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_specs_v1_spec_proto_enumTypes[2].Descriptor() -} - -func (MIGRATE_MODE) Type() protoreflect.EnumType { - return &file_plugin_pb_specs_v1_spec_proto_enumTypes[2] -} - -func (x MIGRATE_MODE) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MIGRATE_MODE.Descriptor instead. -func (MIGRATE_MODE) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{2} -} - -type PK_MODE int32 - -const ( - PK_MODE_DEFAULT PK_MODE = 0 - PK_MODE_CQ_ID_ONLY PK_MODE = 1 -) - -// Enum value maps for PK_MODE. -var ( - PK_MODE_name = map[int32]string{ - 0: "DEFAULT", - 1: "CQ_ID_ONLY", - } - PK_MODE_value = map[string]int32{ - "DEFAULT": 0, - "CQ_ID_ONLY": 1, - } -) - -func (x PK_MODE) Enum() *PK_MODE { - p := new(PK_MODE) - *p = x - return p -} - -func (x PK_MODE) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PK_MODE) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_specs_v1_spec_proto_enumTypes[3].Descriptor() -} - -func (PK_MODE) Type() protoreflect.EnumType { - return &file_plugin_pb_specs_v1_spec_proto_enumTypes[3] -} - -func (x PK_MODE) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PK_MODE.Descriptor instead. -func (PK_MODE) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{3} -} - -type SCHEDULER int32 - -const ( - SCHEDULER_SCHEDULER_DFS SCHEDULER = 0 - SCHEDULER_SCHEDULER_ROUND_ROBIN SCHEDULER = 1 -) - -// Enum value maps for SCHEDULER. -var ( - SCHEDULER_name = map[int32]string{ - 0: "SCHEDULER_DFS", - 1: "SCHEDULER_ROUND_ROBIN", - } - SCHEDULER_value = map[string]int32{ - "SCHEDULER_DFS": 0, - "SCHEDULER_ROUND_ROBIN": 1, - } -) - -func (x SCHEDULER) Enum() *SCHEDULER { - p := new(SCHEDULER) - *p = x - return p -} - -func (x SCHEDULER) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SCHEDULER) Descriptor() protoreflect.EnumDescriptor { - return file_plugin_pb_specs_v1_spec_proto_enumTypes[4].Descriptor() -} - -func (SCHEDULER) Type() protoreflect.EnumType { - return &file_plugin_pb_specs_v1_spec_proto_enumTypes[4] -} - -func (x SCHEDULER) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SCHEDULER.Descriptor instead. -func (SCHEDULER) EnumDescriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{4} -} - -type Spec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Registry REGISTRY `protobuf:"varint,2,opt,name=registry,proto3,enum=cloudquery.specs.v1.REGISTRY" json:"registry,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - SyncSpec *SyncSpec `protobuf:"bytes,5,opt,name=sync_spec,json=syncSpec,proto3" json:"sync_spec,omitempty"` - WriteSpec *WriteSpec `protobuf:"bytes,6,opt,name=write_spec,json=writeSpec,proto3" json:"write_spec,omitempty"` - BackendSpec *Spec `protobuf:"bytes,7,opt,name=backend_spec,json=backendSpec,proto3" json:"backend_spec,omitempty"` - Spec []byte `protobuf:"bytes,8,opt,name=spec,proto3" json:"spec,omitempty"` -} - -func (x *Spec) Reset() { - *x = Spec{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Spec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Spec) ProtoMessage() {} - -func (x *Spec) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_specs_v1_spec_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 Spec.ProtoReflect.Descriptor instead. -func (*Spec) Descriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{0} -} - -func (x *Spec) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Spec) GetRegistry() REGISTRY { - if x != nil { - return x.Registry - } - return REGISTRY_REGISTRY_GITHUB -} - -func (x *Spec) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Spec) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Spec) GetSyncSpec() *SyncSpec { - if x != nil { - return x.SyncSpec - } - return nil -} - -func (x *Spec) GetWriteSpec() *WriteSpec { - if x != nil { - return x.WriteSpec - } - return nil -} - -func (x *Spec) GetBackendSpec() *Spec { - if x != nil { - return x.BackendSpec - } - return nil -} - -func (x *Spec) GetSpec() []byte { - if x != nil { - return x.Spec - } - return nil -} - -type WriteSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - WriteMode WRITE_MODE `protobuf:"varint,1,opt,name=write_mode,json=writeMode,proto3,enum=cloudquery.specs.v1.WRITE_MODE" json:"write_mode,omitempty"` - MigrateMode MIGRATE_MODE `protobuf:"varint,2,opt,name=migrate_mode,json=migrateMode,proto3,enum=cloudquery.specs.v1.MIGRATE_MODE" json:"migrate_mode,omitempty"` - BatchSize uint64 `protobuf:"varint,3,opt,name=batch_size,json=batchSize,proto3" json:"batch_size,omitempty"` - BatchSizeBytes uint64 `protobuf:"varint,4,opt,name=batch_size_bytes,json=batchSizeBytes,proto3" json:"batch_size_bytes,omitempty"` - PkMode PK_MODE `protobuf:"varint,5,opt,name=pk_mode,json=pkMode,proto3,enum=cloudquery.specs.v1.PK_MODE" json:"pk_mode,omitempty"` -} - -func (x *WriteSpec) Reset() { - *x = WriteSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WriteSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteSpec) ProtoMessage() {} - -func (x *WriteSpec) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_specs_v1_spec_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 WriteSpec.ProtoReflect.Descriptor instead. -func (*WriteSpec) Descriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{1} -} - -func (x *WriteSpec) GetWriteMode() WRITE_MODE { - if x != nil { - return x.WriteMode - } - return WRITE_MODE_WRITE_MODE_OVERWRITE_DELETE_STALE -} - -func (x *WriteSpec) GetMigrateMode() MIGRATE_MODE { - if x != nil { - return x.MigrateMode - } - return MIGRATE_MODE_SAFE -} - -func (x *WriteSpec) GetBatchSize() uint64 { - if x != nil { - return x.BatchSize - } - return 0 -} - -func (x *WriteSpec) GetBatchSizeBytes() uint64 { - if x != nil { - return x.BatchSizeBytes - } - return 0 -} - -func (x *WriteSpec) GetPkMode() PK_MODE { - if x != nil { - return x.PkMode - } - return PK_MODE_DEFAULT -} - -type SyncSpec struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"` - SkipTables []string `protobuf:"bytes,2,rep,name=skip_tables,json=skipTables,proto3" json:"skip_tables,omitempty"` - Destinations []string `protobuf:"bytes,3,rep,name=destinations,proto3" json:"destinations,omitempty"` - Concurrency uint64 `protobuf:"varint,4,opt,name=concurrency,proto3" json:"concurrency,omitempty"` - Scheduler SCHEDULER `protobuf:"varint,5,opt,name=scheduler,proto3,enum=cloudquery.specs.v1.SCHEDULER" json:"scheduler,omitempty"` - DetrministicCqId bool `protobuf:"varint,6,opt,name=detrministic_cq_id,json=detrministicCqId,proto3" json:"detrministic_cq_id,omitempty"` -} - -func (x *SyncSpec) Reset() { - *x = SyncSpec{} - if protoimpl.UnsafeEnabled { - mi := &file_plugin_pb_specs_v1_spec_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncSpec) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncSpec) ProtoMessage() {} - -func (x *SyncSpec) ProtoReflect() protoreflect.Message { - mi := &file_plugin_pb_specs_v1_spec_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 SyncSpec.ProtoReflect.Descriptor instead. -func (*SyncSpec) Descriptor() ([]byte, []int) { - return file_plugin_pb_specs_v1_spec_proto_rawDescGZIP(), []int{2} -} - -func (x *SyncSpec) GetTables() []string { - if x != nil { - return x.Tables - } - return nil -} - -func (x *SyncSpec) GetSkipTables() []string { - if x != nil { - return x.SkipTables - } - return nil -} - -func (x *SyncSpec) GetDestinations() []string { - if x != nil { - return x.Destinations - } - return nil -} - -func (x *SyncSpec) GetConcurrency() uint64 { - if x != nil { - return x.Concurrency - } - return 0 -} - -func (x *SyncSpec) GetScheduler() SCHEDULER { - if x != nil { - return x.Scheduler - } - return SCHEDULER_SCHEDULER_DFS -} - -func (x *SyncSpec) GetDetrministicCqId() bool { - if x != nil { - return x.DetrministicCqId - } - return false -} - -var File_plugin_pb_specs_v1_spec_proto protoreflect.FileDescriptor - -var file_plugin_pb_specs_v1_spec_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2f, 0x73, 0x70, 0x65, 0x63, - 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x13, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, - 0x73, 0x2e, 0x76, 0x31, 0x22, 0xd0, 0x02, 0x0a, 0x04, 0x53, 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, - 0x52, 0x59, 0x52, 0x08, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x09, 0x73, 0x79, - 0x6e, 0x63, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x52, 0x08, 0x73, 0x79, - 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, - 0x73, 0x70, 0x65, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3c, 0x0a, 0x0c, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, - 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0b, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x53, - 0x70, 0x65, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x70, 0x65, 0x63, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x91, 0x02, 0x0a, 0x09, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3e, 0x0a, 0x0a, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6d, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x63, 0x6c, 0x6f, 0x75, - 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x52, 0x09, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x44, 0x0a, 0x0c, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x52, 0x0b, - 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x61, - 0x74, 0x63, 0x68, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x62, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7a, 0x65, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x07, 0x70, 0x6b, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x4b, 0x5f, 0x4d, - 0x4f, 0x44, 0x45, 0x52, 0x06, 0x70, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x22, 0xf5, 0x01, 0x0a, 0x08, - 0x53, 0x79, 0x6e, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, - 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x63, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x63, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x3c, 0x0a, 0x09, 0x73, 0x63, 0x68, 0x65, 0x64, - 0x75, 0x6c, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x52, 0x09, 0x73, 0x63, 0x68, 0x65, - 0x64, 0x75, 0x6c, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x64, 0x65, 0x74, 0x72, 0x6d, 0x69, 0x6e, - 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x63, 0x71, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x10, 0x64, 0x65, 0x74, 0x72, 0x6d, 0x69, 0x6e, 0x69, 0x73, 0x74, 0x69, 0x63, 0x43, - 0x71, 0x49, 0x64, 0x2a, 0x64, 0x0a, 0x0a, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, - 0x45, 0x12, 0x25, 0x0a, 0x21, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, - 0x4f, 0x56, 0x45, 0x52, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, - 0x5f, 0x53, 0x54, 0x41, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x57, 0x52, 0x49, 0x54, - 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x57, 0x52, 0x49, 0x54, 0x45, - 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x45, - 0x5f, 0x41, 0x50, 0x50, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x2a, 0x46, 0x0a, 0x08, 0x52, 0x45, 0x47, - 0x49, 0x53, 0x54, 0x52, 0x59, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, - 0x59, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x52, 0x45, - 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x12, 0x0a, - 0x0e, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x10, - 0x02, 0x2a, 0x23, 0x0a, 0x0c, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4d, 0x4f, 0x44, - 0x45, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x41, 0x46, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x46, - 0x4f, 0x52, 0x43, 0x45, 0x10, 0x01, 0x2a, 0x26, 0x0a, 0x07, 0x50, 0x4b, 0x5f, 0x4d, 0x4f, 0x44, - 0x45, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0e, - 0x0a, 0x0a, 0x43, 0x51, 0x5f, 0x49, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x2a, 0x39, - 0x0a, 0x09, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x12, 0x11, 0x0a, 0x0d, 0x53, - 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x44, 0x46, 0x53, 0x10, 0x00, 0x12, 0x19, - 0x0a, 0x15, 0x53, 0x43, 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x55, 0x4e, - 0x44, 0x5f, 0x52, 0x4f, 0x42, 0x49, 0x4e, 0x10, 0x01, 0x42, 0x36, 0x5a, 0x34, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2d, 0x70, 0x62, 0x2d, 0x67, 0x6f, 0x2f, - 0x70, 0x62, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x70, 0x65, 0x63, - 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_plugin_pb_specs_v1_spec_proto_rawDescOnce sync.Once - file_plugin_pb_specs_v1_spec_proto_rawDescData = file_plugin_pb_specs_v1_spec_proto_rawDesc -) - -func file_plugin_pb_specs_v1_spec_proto_rawDescGZIP() []byte { - file_plugin_pb_specs_v1_spec_proto_rawDescOnce.Do(func() { - file_plugin_pb_specs_v1_spec_proto_rawDescData = protoimpl.X.CompressGZIP(file_plugin_pb_specs_v1_spec_proto_rawDescData) - }) - return file_plugin_pb_specs_v1_spec_proto_rawDescData -} - -var file_plugin_pb_specs_v1_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_plugin_pb_specs_v1_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_plugin_pb_specs_v1_spec_proto_goTypes = []interface{}{ - (WRITE_MODE)(0), // 0: cloudquery.specs.v1.WRITE_MODE - (REGISTRY)(0), // 1: cloudquery.specs.v1.REGISTRY - (MIGRATE_MODE)(0), // 2: cloudquery.specs.v1.MIGRATE_MODE - (PK_MODE)(0), // 3: cloudquery.specs.v1.PK_MODE - (SCHEDULER)(0), // 4: cloudquery.specs.v1.SCHEDULER - (*Spec)(nil), // 5: cloudquery.specs.v1.Spec - (*WriteSpec)(nil), // 6: cloudquery.specs.v1.WriteSpec - (*SyncSpec)(nil), // 7: cloudquery.specs.v1.SyncSpec -} -var file_plugin_pb_specs_v1_spec_proto_depIdxs = []int32{ - 1, // 0: cloudquery.specs.v1.Spec.registry:type_name -> cloudquery.specs.v1.REGISTRY - 7, // 1: cloudquery.specs.v1.Spec.sync_spec:type_name -> cloudquery.specs.v1.SyncSpec - 6, // 2: cloudquery.specs.v1.Spec.write_spec:type_name -> cloudquery.specs.v1.WriteSpec - 5, // 3: cloudquery.specs.v1.Spec.backend_spec:type_name -> cloudquery.specs.v1.Spec - 0, // 4: cloudquery.specs.v1.WriteSpec.write_mode:type_name -> cloudquery.specs.v1.WRITE_MODE - 2, // 5: cloudquery.specs.v1.WriteSpec.migrate_mode:type_name -> cloudquery.specs.v1.MIGRATE_MODE - 3, // 6: cloudquery.specs.v1.WriteSpec.pk_mode:type_name -> cloudquery.specs.v1.PK_MODE - 4, // 7: cloudquery.specs.v1.SyncSpec.scheduler:type_name -> cloudquery.specs.v1.SCHEDULER - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_plugin_pb_specs_v1_spec_proto_init() } -func file_plugin_pb_specs_v1_spec_proto_init() { - if File_plugin_pb_specs_v1_spec_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_plugin_pb_specs_v1_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Spec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_pb_specs_v1_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WriteSpec); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_plugin_pb_specs_v1_spec_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncSpec); 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_plugin_pb_specs_v1_spec_proto_rawDesc, - NumEnums: 5, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_plugin_pb_specs_v1_spec_proto_goTypes, - DependencyIndexes: file_plugin_pb_specs_v1_spec_proto_depIdxs, - EnumInfos: file_plugin_pb_specs_v1_spec_proto_enumTypes, - MessageInfos: file_plugin_pb_specs_v1_spec_proto_msgTypes, - }.Build() - File_plugin_pb_specs_v1_spec_proto = out.File - file_plugin_pb_specs_v1_spec_proto_rawDesc = nil - file_plugin_pb_specs_v1_spec_proto_goTypes = nil - file_plugin_pb_specs_v1_spec_proto_depIdxs = nil -} diff --git a/specs/v1/migrate_mode.go b/specs/v1/migrate_mode.go deleted file mode 100644 index f821b0c2..00000000 --- a/specs/v1/migrate_mode.go +++ /dev/null @@ -1,50 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type MigrateMode int - -const ( - MigrateModeSafe MigrateMode = iota - MigrateModeForced -) - -var ( - migrateModeStrings = []string{"safe", "forced"} -) - -func (m MigrateMode) String() string { - return migrateModeStrings[m] -} - -func (m MigrateMode) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBufferString(`"`) - buffer.WriteString(m.String()) - buffer.WriteString(`"`) - return buffer.Bytes(), nil -} - -func (m *MigrateMode) UnmarshalJSON(data []byte) (err error) { - var migrateMode string - if err := json.Unmarshal(data, &migrateMode); err != nil { - return err - } - if *m, err = MigrateModeFromString(migrateMode); err != nil { - return err - } - return nil -} - -func MigrateModeFromString(s string) (MigrateMode, error) { - switch s { - case "safe": - return MigrateModeSafe, nil - case "forced": - return MigrateModeForced, nil - } - return 0, fmt.Errorf("invalid migrate mode: %s", s) -} diff --git a/specs/v1/migrate_mode_test.go b/specs/v1/migrate_mode_test.go deleted file mode 100644 index 34bc2efb..00000000 --- a/specs/v1/migrate_mode_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package specs - -import ( - "testing" -) - -func TestMigrateModeFromString(t *testing.T) { - var migrateMode MigrateMode - if err := migrateMode.UnmarshalJSON([]byte(`"forced"`)); err != nil { - t.Fatal(err) - } - if migrateMode != MigrateModeForced { - t.Fatalf("expected MigrateModeForced, got %v", migrateMode) - } - if err := migrateMode.UnmarshalJSON([]byte(`"safe"`)); err != nil { - t.Fatal(err) - } - if migrateMode != MigrateModeSafe { - t.Fatalf("expected MigrateModeSafe, got %v", migrateMode) - } -} - -func TestMigrateMode(t *testing.T) { - for _, migrateModeStr := range migrateModeStrings { - migrateMode, err := MigrateModeFromString(migrateModeStr) - if err != nil { - t.Fatal(err) - } - if migrateModeStr != migrateMode.String() { - t.Fatalf("expected:%s got:%s", migrateMode, migrateMode.String()) - } - } -} diff --git a/specs/v1/pk_mode.go b/specs/v1/pk_mode.go deleted file mode 100644 index 38c22bb1..00000000 --- a/specs/v1/pk_mode.go +++ /dev/null @@ -1,50 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type PKMode int - -const ( - PKModeDefaultKeys PKMode = iota - PKModeCQID -) - -var ( - pkModeStrings = []string{"default", "cq-id-only"} -) - -func (m PKMode) String() string { - return pkModeStrings[m] -} - -func (m PKMode) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBufferString(`"`) - buffer.WriteString(m.String()) - buffer.WriteString(`"`) - return buffer.Bytes(), nil -} - -func (m *PKMode) UnmarshalJSON(data []byte) (err error) { - var pkMode string - if err := json.Unmarshal(data, &pkMode); err != nil { - return err - } - if *m, err = PKModeFromString(pkMode); err != nil { - return err - } - return nil -} - -func PKModeFromString(s string) (PKMode, error) { - switch s { - case "default": - return PKModeDefaultKeys, nil - case "cq-id-only": - return PKModeCQID, nil - } - return 0, fmt.Errorf("invalid pk mode: %s", s) -} diff --git a/specs/v1/pk_mode_test.go b/specs/v1/pk_mode_test.go deleted file mode 100644 index 198d185e..00000000 --- a/specs/v1/pk_mode_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package specs - -import ( - "testing" -) - -func TestPKModeFromString(t *testing.T) { - var pkMode PKMode - if err := pkMode.UnmarshalJSON([]byte(`"cq-id-only"`)); err != nil { - t.Fatal(err) - } - if pkMode != PKModeCQID { - t.Fatalf("expected PKModeCQID, got %v", pkMode) - } - if err := pkMode.UnmarshalJSON([]byte(`"default"`)); err != nil { - t.Fatal(err) - } - if pkMode != PKModeDefaultKeys { - t.Fatalf("expected PKModeCompositeKeys, got %v", pkMode) - } -} - -func TestPKMode(t *testing.T) { - for _, pkModeStr := range pkModeStrings { - pkMode, err := PKModeFromString(pkModeStr) - if err != nil { - t.Fatal(err) - } - if pkModeStr != pkMode.String() { - t.Fatalf("expected:%s got:%s", pkModeStr, pkMode.String()) - } - } -} - -func TestPKModeMarshalJSON(t *testing.T) { - pkMode := PKModeCQID - if pkModeStr, err := pkMode.MarshalJSON(); err != nil { - t.Fatal(err) - } else if string(pkModeStr) != `"cq-id-only"` { - t.Fatalf("expected:\"cq-id\" got:%s", string(pkModeStr)) - } - - pkMode = PKModeDefaultKeys - if pkModeStr, err := pkMode.MarshalJSON(); err != nil { - t.Fatal(err) - } else if string(pkModeStr) != `"default"` { - t.Fatalf("expected:\"cq-id\" got:%s", string(pkModeStr)) - } -} diff --git a/specs/v1/plugin.go b/specs/v1/plugin.go deleted file mode 100644 index 114f630a..00000000 --- a/specs/v1/plugin.go +++ /dev/null @@ -1,97 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" - "strings" - - "github.com/thoas/go-funk" -) - -// Plugin is the spec for a CloudQuery plugin -type Plugin struct { - // Name of the source plugin to use - Name string `json:"name,omitempty"` - // Version of the source plugin to use - Version string `json:"version,omitempty"` - // Path is the canonical path to the source plugin in a given registry - // For example: - // in github the path will be: org/repo - // For the local registry the path will be the path to the binary: ./path/to/binary - // For the gRPC registry the path will be the address of the gRPC server: host:port - Path string - // Registry can be github,local,grpc. - Registry Registry `json:"registry,omitempty"` - // Sync defines sync behaviour - Sync Sync `json:"sync,omitempty"` - // StateBackend specifies the state backend to use - // for incremental syncs - StateBackend *Plugin `json:"backend,omitempty"` - // Write specifies write behaviour - Write Write `json:"write,omitempty"` - // Spec is defined by each plugin - Spec any `json:"spec,omitempty"` -} - -func (d *Plugin) UnmarshalSpec(out any) error { - b, err := json.Marshal(d.Spec) - if err != nil { - return err - } - dec := json.NewDecoder(bytes.NewReader(b)) - dec.UseNumber() - dec.DisallowUnknownFields() - return dec.Decode(out) -} - -func (d *Plugin) VersionString() string { - if d.Registry != RegistryGithub { - return fmt.Sprintf("%s (%s@%s)", d.Name, d.Registry, d.Path) - } - pathParts := strings.Split(d.Path, "/") - if len(pathParts) != 2 { - return fmt.Sprintf("%s (%s@%s)", d.Name, d.Path, d.Version) - } - if d.Name == pathParts[1] { - return fmt.Sprintf("%s (%s)", d.Name, d.Version) - } - return fmt.Sprintf("%s (%s@%s)", d.Name, pathParts[1], d.Version) -} - -func (d *Plugin) SetDefaults(defaultBatchSize, defaultBatchSizeBytes int) { - if d.Write.BatchSize == 0 { - d.Write.BatchSize = defaultBatchSize - } - if d.Write.BatchSizeBytes == 0 { - d.Write.BatchSizeBytes = defaultBatchSizeBytes - } -} - -func (d *Plugin) Validate() error { - if d.Name == "" { - return fmt.Errorf("name is required") - } - if d.Path == "" { - msg := "path is required" - // give a small hint to help users transition from the old config format that didn't require path - officialPlugins := []string{"postgresql", "csv"} - if funk.ContainsString(officialPlugins, d.Name) { - msg += fmt.Sprintf(". Hint: try setting path to cloudquery/%s in your config", d.Name) - } - return fmt.Errorf(msg) - } - - if d.Registry == RegistryGithub { - if d.Version == "" { - return fmt.Errorf("version is required") - } - if !strings.HasPrefix(d.Version, "v") { - return fmt.Errorf("version must start with v") - } - } - if d.Write.BatchSize < 0 { - return fmt.Errorf("batch_size must be greater than 0") - } - return nil -} diff --git a/specs/v1/plugin_test.go b/specs/v1/plugin_test.go deleted file mode 100644 index 19dd1567..00000000 --- a/specs/v1/plugin_test.go +++ /dev/null @@ -1,270 +0,0 @@ -package specs - -import ( - "testing" - - "github.com/google/go-cmp/cmp" -) - -type testDestinationSpec struct { - ConnectionString string `json:"connection_string"` -} - -func TestPluginSpecUnmarshalSpec(t *testing.T) { - pluginSpec := Plugin{ - Spec: map[string]any{ - "connection_string": "postgres://user:pass@host:port/db", - }, - } - var spec testDestinationSpec - if err := pluginSpec.UnmarshalSpec(&spec); err != nil { - t.Fatal(err) - } - if spec.ConnectionString != "postgres://user:pass@host:port/db" { - t.Fatalf("expected postgres://user:pass@host:port/db, got %s", spec.ConnectionString) - } -} - -var pluginUnmarshalSpecTestCases = []struct { - name string - spec string - err string - source *Sync -}{ - { - "invalid_kind", - `kind: nice`, - "failed to decode spec: unknown kind nice", - nil, - }, - { - "invalid_type", - `kind: plugin -spec: - name: 3 -`, - "failed to decode spec: json: cannot unmarshal number into Go struct field Plugin.name of type string", - &Sync{ - Tables: []string{"*"}, - }, - }, - { - "unknown_field", - `kind: plugin -spec: - namea: 3 -`, - `failed to decode spec: json: unknown field "namea"`, - &Sync{ - Tables: []string{"*"}, - }, - }, -} - -func TestDestinationUnmarshalSpec(t *testing.T) { - for _, tc := range pluginUnmarshalSpecTestCases { - t.Run(tc.name, func(t *testing.T) { - var err error - var spec Spec - err = SpecUnmarshalYamlStrict([]byte(tc.spec), &spec) - if err != nil { - if err.Error() != tc.err { - t.Fatalf("expected:%s got:%s", tc.err, err.Error()) - } - return - } - - source := spec.Spec.(*Sync) - if cmp.Diff(source, tc.source) != "" { - t.Fatalf("expected:%v got:%v", tc.source, source) - } - }) - } -} - -var destinationUnmarshalSpecValidateTestCases = []struct { - name string - spec string - err string - plugin *Plugin -}{ - { - "required_name", - `kind: plugin -spec:`, - "name is required", - nil, - }, - { - "required_version", - `kind: plugin -spec: - name: test - path: cloudquery/test -`, - "version is required", - nil, - }, - { - "required_version_format", - `kind: plugin -spec: - name: test - path: cloudquery/test - version: 1.1.0 -`, - "version must start with v", - nil, - }, - { - "version_is_not_required_for_grpc_registry", - `kind: plugin -spec: - name: test - registry: grpc - path: "localhost:9999" -`, - "", - &Plugin{ - Name: "test", - Registry: RegistryGrpc, - Path: "localhost:9999", - Write: Write{ - BatchSize: 10000, - BatchSizeBytes: 10000000, - }, - }, - }, - { - "version_is_not_required_for_local_registry", - `kind: plugin -spec: - name: test - registry: local - path: "/home/user/some_executable" -`, - "", - &Plugin{ - Name: "test", - Registry: RegistryLocal, - Path: "/home/user/some_executable", - Write: Write{ - BatchSize: 10000, - BatchSizeBytes: 10000000, - }, - }, - }, - { - "success", - `kind: plugin -spec: - name: test - path: cloudquery/test - version: v1.1.0 -`, - "", - &Plugin{ - Name: "test", - Path: "cloudquery/test", - Version: "v1.1.0", - Write: Write{ - BatchSize: 10000, - BatchSizeBytes: 10000000, - }, - }, - }, -} - -func TestDestinationUnmarshalSpecValidate(t *testing.T) { - for _, tc := range destinationUnmarshalSpecValidateTestCases { - t.Run(tc.name, func(t *testing.T) { - var err error - var spec Spec - err = SpecUnmarshalYamlStrict([]byte(tc.spec), &spec) - if err != nil { - t.Fatal(err) - } - p := spec.Spec.(*Plugin) - p.SetDefaults(10000, 10000000) - err = p.Validate() - if err != nil { - if err.Error() != tc.err { - t.Fatalf("expected:\n%s\ngot:\n%s", tc.err, err.Error()) - } - return - } - - if cmp.Diff(p, tc.plugin) != "" { - t.Fatalf("expected:\n%v\ngot:\n%v\n", tc.plugin, p) - } - }) - } -} - -func TestDestination_VersionString(t *testing.T) { - type fields struct { - Name string - Version string - Path string - Registry Registry - } - tests := []struct { - name string - fields fields - want string - }{ - { - name: "should use short version without name part in path when those are the same", - fields: fields{ - Name: "aws", - Version: "v10.0.0", - Path: "cloudquery/aws", - Registry: RegistryGithub, - }, - want: "aws (v10.0.0)", - }, - { - name: "should use long version with path when name doesn't match path", - fields: fields{ - Name: "my-aws-spec", - Version: "v10.0.0", - Path: "cloudquery/aws", - Registry: RegistryGithub, - }, - want: "my-aws-spec (aws@v10.0.0)", - }, - { - name: "should handle non GitHub registry", - fields: fields{ - Name: "my-aws-spec", - Version: "v10.0.0", - Path: "localhost:7777", - Registry: RegistryGrpc, - }, - want: "my-aws-spec (grpc@localhost:7777)", - }, - { - name: "should handle malformed path", - fields: fields{ - Name: "my-aws-spec", - Version: "v10.0.0", - Path: "aws", - Registry: RegistryGithub, - }, - want: "my-aws-spec (aws@v10.0.0)", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - d := Plugin{ - Name: tt.fields.Name, - Version: tt.fields.Version, - Path: tt.fields.Path, - Registry: tt.fields.Registry, - } - if got := d.VersionString(); got != tt.want { - t.Errorf("Destination.String() = %v, want %v", got, tt.want) - } - }) - } -} diff --git a/specs/v1/registry.go b/specs/v1/registry.go deleted file mode 100644 index b18bf3bc..00000000 --- a/specs/v1/registry.go +++ /dev/null @@ -1,49 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type Registry int - -const ( - RegistryGithub Registry = iota - RegistryLocal - RegistryGrpc -) - -func (r Registry) String() string { - return [...]string{"github", "local", "grpc"}[r] -} -func (r Registry) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBufferString(`"`) - buffer.WriteString(r.String()) - buffer.WriteString(`"`) - return buffer.Bytes(), nil -} - -func (r *Registry) UnmarshalJSON(data []byte) (err error) { - var registry string - if err := json.Unmarshal(data, ®istry); err != nil { - return err - } - if *r, err = RegistryFromString(registry); err != nil { - return err - } - return nil -} - -func RegistryFromString(s string) (Registry, error) { - switch s { - case "github": - return RegistryGithub, nil - case "local": - return RegistryLocal, nil - case "grpc": - return RegistryGrpc, nil - default: - return RegistryGithub, fmt.Errorf("unknown registry %s", s) - } -} diff --git a/specs/v1/registry_test.go b/specs/v1/registry_test.go deleted file mode 100644 index d7751a27..00000000 --- a/specs/v1/registry_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package specs - -import ( - "encoding/json" - "testing" - - "gopkg.in/yaml.v3" -) - -func TestRegistryJsonMarshalUnmarshal(t *testing.T) { - b, err := json.Marshal(RegistryGrpc) - if err != nil { - t.Fatal("failed to marshal registry:", err) - } - var registry Registry - if err := json.Unmarshal(b, ®istry); err != nil { - t.Fatal("failed to unmarshal registry:", err) - } - if registry != RegistryGrpc { - t.Fatal("expected registry to be github, but got:", registry) - } -} - -func TestRegistryYamlMarshalUnmarsahl(t *testing.T) { - b, err := yaml.Marshal(RegistryGrpc) - if err != nil { - t.Fatal("failed to marshal registry:", err) - } - var registry Registry - if err := yaml.Unmarshal(b, ®istry); err != nil { - t.Fatal("failed to unmarshal registry:", err) - } - if registry != RegistryGrpc { - t.Fatal("expected registry to be github, but got:", registry) - } -} diff --git a/specs/v1/scheduler.go b/specs/v1/scheduler.go deleted file mode 100644 index 2f7ddd5d..00000000 --- a/specs/v1/scheduler.go +++ /dev/null @@ -1,60 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type Scheduler int - -const ( - SchedulerDFS Scheduler = iota - SchedulerRoundRobin -) - -var AllSchedulers = Schedulers{SchedulerDFS, SchedulerRoundRobin} -var AllSchedulerNames = [...]string{ - SchedulerDFS: "dfs", - SchedulerRoundRobin: "round-robin", -} - -type Schedulers []Scheduler - -func (s Schedulers) String() string { - var buffer bytes.Buffer - for i, scheduler := range s { - if i > 0 { - buffer.WriteString(", ") - } - buffer.WriteString(scheduler.String()) - } - return buffer.String() -} - -func (s Scheduler) String() string { - return AllSchedulerNames[s] -} -func (s Scheduler) MarshalJSON() ([]byte, error) { - return []byte(`"` + s.String() + `"`), nil -} - -func (s *Scheduler) UnmarshalJSON(data []byte) (err error) { - var scheduler string - if err := json.Unmarshal(data, &scheduler); err != nil { - return err - } - if *s, err = SchedulerFromString(scheduler); err != nil { - return err - } - return nil -} - -func SchedulerFromString(s string) (Scheduler, error) { - for i, scheduler := range AllSchedulerNames { - if s == scheduler { - return Scheduler(i), nil - } - } - return SchedulerDFS, fmt.Errorf("unknown scheduler %s", s) -} diff --git a/specs/v1/scheduler_test.go b/specs/v1/scheduler_test.go deleted file mode 100644 index e63f61d4..00000000 --- a/specs/v1/scheduler_test.go +++ /dev/null @@ -1,36 +0,0 @@ -package specs - -import ( - "encoding/json" - "testing" - - "gopkg.in/yaml.v3" -) - -func TestSchedulerJsonMarshalUnmarshal(t *testing.T) { - b, err := json.Marshal(SchedulerDFS) - if err != nil { - t.Fatal("failed to marshal scheduler:", err) - } - var scheduler Scheduler - if err := json.Unmarshal(b, &scheduler); err != nil { - t.Fatal("failed to unmarshal scheduler:", err) - } - if scheduler != SchedulerDFS { - t.Fatal("expected scheduler to be dfs, but got:", scheduler) - } -} - -func TestSchedulerYamlMarshalUnmarshal(t *testing.T) { - b, err := yaml.Marshal(SchedulerDFS) - if err != nil { - t.Fatal("failed to marshal scheduler:", err) - } - var scheduler Scheduler - if err := yaml.Unmarshal(b, &scheduler); err != nil { - t.Fatal("failed to unmarshal scheduler:", err) - } - if scheduler != SchedulerDFS { - t.Fatal("expected scheduler to be dfs, but got:", scheduler) - } -} diff --git a/specs/v1/spec.go b/specs/v1/spec.go deleted file mode 100644 index 8717dfd2..00000000 --- a/specs/v1/spec.go +++ /dev/null @@ -1,100 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" - - "github.com/ghodss/yaml" -) - -type Kind int - -type Spec struct { - Kind Kind `json:"kind"` - Spec any `json:"spec"` -} - -const ( - KindPlugin Kind = iota -) - -func (k Kind) String() string { - return [...]string{"plugin"}[k] -} - -func (k Kind) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBufferString(`"`) - buffer.WriteString(k.String()) - buffer.WriteString(`"`) - return buffer.Bytes(), nil -} - -func (k *Kind) UnmarshalJSON(data []byte) (err error) { - var kind string - if err := json.Unmarshal(data, &kind); err != nil { - return err - } - if *k, err = KindFromString(kind); err != nil { - return err - } - return nil -} - -func KindFromString(s string) (Kind, error) { - switch s { - case "plugin": - return KindPlugin, nil - default: - return KindPlugin, fmt.Errorf("unknown kind %s", s) - } -} - -func (s *Spec) UnmarshalJSON(data []byte) error { - var t struct { - Kind Kind `json:"kind"` - Spec any `json:"spec"` - } - dec := json.NewDecoder(bytes.NewReader(data)) - dec.DisallowUnknownFields() - dec.UseNumber() - if err := dec.Decode(&t); err != nil { - return err - } - s.Kind = t.Kind - switch s.Kind { - case KindPlugin: - s.Spec = new(Plugin) - default: - return fmt.Errorf("unknown kind %s", s.Kind) - } - b, err := json.Marshal(t.Spec) - if err != nil { - return err - } - dec = json.NewDecoder(bytes.NewReader(b)) - dec.UseNumber() - dec.DisallowUnknownFields() - return dec.Decode(s.Spec) -} - -func UnmarshalJSONStrict(b []byte, out any) error { - dec := json.NewDecoder(bytes.NewReader(b)) - dec.DisallowUnknownFields() - dec.UseNumber() - return dec.Decode(out) -} - -func SpecUnmarshalYamlStrict(b []byte, spec *Spec) error { - jb, err := yaml.YAMLToJSON(b) - if err != nil { - return fmt.Errorf("failed to convert yaml to json: %w", err) - } - dec := json.NewDecoder(bytes.NewReader(jb)) - dec.DisallowUnknownFields() - dec.UseNumber() - if err := dec.Decode(spec); err != nil { - return fmt.Errorf("failed to decode spec: %w", err) - } - return nil -} diff --git a/specs/v1/sync.go b/specs/v1/sync.go deleted file mode 100644 index a41ea9c0..00000000 --- a/specs/v1/sync.go +++ /dev/null @@ -1,18 +0,0 @@ -package specs - -type Sync struct { - Concurrency uint64 `json:"concurrency,omitempty"` - // Tables to sync from the source plugin - Tables []string `json:"tables,omitempty"` - // SkipTables defines tables to skip when syncing data. Useful if a glob pattern is used in Tables - SkipTables []string `json:"skip_tables,omitempty"` - // SkipDependentTables changes the matching behavior with regard to dependent tables. If set to true, dependent tables will not be synced unless they are explicitly matched by Tables. - SkipDependentTables bool `json:"skip_dependent_tables,omitempty"` - // Destinations are the names of destination plugins to send sync data to - Destinations []string `json:"destinations,omitempty"` - // Scheduler defines the scheduling algorithm that should be used to sync data - Scheduler Scheduler `json:"scheduler,omitempty"` - // DeterministicCQID is a flag that indicates whether the source plugin should generate a random UUID as the value of _cq_id - // or whether it should calculate a UUID that is a hash of the primary keys (if they exist) or the entire resource. - DeterministicCQID bool `json:"deterministic_cq_id,omitempty"` -} diff --git a/specs/v1/write.go b/specs/v1/write.go deleted file mode 100644 index c0ba06f8..00000000 --- a/specs/v1/write.go +++ /dev/null @@ -1,9 +0,0 @@ -package specs - -type Write struct { - WriteMode WriteMode `json:"write_mode,omitempty"` - MigrateMode MigrateMode `json:"migrate_mode,omitempty"` - BatchSize int `json:"batch_size,omitempty"` - BatchSizeBytes int `json:"batch_size_bytes,omitempty"` - PKMode PKMode `json:"pk_mode,omitempty"` -} diff --git a/specs/v1/write_mode.go b/specs/v1/write_mode.go deleted file mode 100644 index 546e21c8..00000000 --- a/specs/v1/write_mode.go +++ /dev/null @@ -1,53 +0,0 @@ -package specs - -import ( - "bytes" - "encoding/json" - "fmt" -) - -type WriteMode int - -const ( - WriteModeOverwriteDeleteStale WriteMode = iota - WriteModeOverwrite - WriteModeAppend -) - -var ( - writeModeStrings = []string{"overwrite-delete-stale", "overwrite", "append"} -) - -func (m WriteMode) String() string { - return writeModeStrings[m] -} - -func (m WriteMode) MarshalJSON() ([]byte, error) { - buffer := bytes.NewBufferString(`"`) - buffer.WriteString(m.String()) - buffer.WriteString(`"`) - return buffer.Bytes(), nil -} - -func (m *WriteMode) UnmarshalJSON(data []byte) (err error) { - var writeMode string - if err := json.Unmarshal(data, &writeMode); err != nil { - return err - } - if *m, err = WriteModeFromString(writeMode); err != nil { - return err - } - return nil -} - -func WriteModeFromString(s string) (WriteMode, error) { - switch s { - case "append": - return WriteModeAppend, nil - case "overwrite": - return WriteModeOverwrite, nil - case "overwrite-delete-stale": - return WriteModeOverwriteDeleteStale, nil - } - return 0, fmt.Errorf("invalid write mode: %s", s) -} diff --git a/specs/v1/write_mode_test.go b/specs/v1/write_mode_test.go deleted file mode 100644 index 289c66c2..00000000 --- a/specs/v1/write_mode_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package specs - -import ( - "testing" -) - -func TestWriteModeFromString(t *testing.T) { - var writeMode WriteMode - if err := writeMode.UnmarshalJSON([]byte(`"append"`)); err != nil { - t.Fatal(err) - } - if writeMode != WriteModeAppend { - t.Fatalf("expected WriteModeAppend, got %v", writeMode) - } - if err := writeMode.UnmarshalJSON([]byte(`"overwrite"`)); err != nil { - t.Fatal(err) - } - if writeMode != WriteModeOverwrite { - t.Fatalf("expected WriteModeOverwrite, got %v", writeMode) - } -} - -func TestWriteMode(t *testing.T) { - for _, writeModeStr := range writeModeStrings { - writeMode, err := WriteModeFromString(writeModeStr) - if err != nil { - t.Fatal(err) - } - if writeModeStr != writeMode.String() { - t.Fatalf("expected:%s got:%s", writeModeStr, writeMode.String()) - } - } -} From a2a0e92392826d4575e6fd7a7202118a89c7daaf Mon Sep 17 00:00:00 2001 From: Herman Schaaf Date: Wed, 21 Jun 2023 14:59:00 +0100 Subject: [PATCH 6/6] Add support for metrics on managedplugin --- managedplugin/logging.go | 4 +++- managedplugin/metrics.go | 16 ++++++++++++++++ managedplugin/plugin.go | 8 +++++++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 managedplugin/metrics.go diff --git a/managedplugin/logging.go b/managedplugin/logging.go index 7ec6b4d5..cf692af7 100644 --- a/managedplugin/logging.go +++ b/managedplugin/logging.go @@ -2,7 +2,7 @@ package managedplugin import "github.com/rs/zerolog" -func JSONToLog(l zerolog.Logger, msg map[string]any) { +func (c *Client) jsonToLog(l zerolog.Logger, msg map[string]any) { level := msg["level"] delete(msg, "level") switch level { @@ -14,8 +14,10 @@ func JSONToLog(l zerolog.Logger, msg map[string]any) { l.Info().Fields(msg).Msg("") case "warn": l.Warn().Fields(msg).Msg("") + c.metrics.incrementWarnings() case "error": l.Error().Fields(msg).Msg("") + c.metrics.incrementErrors() default: l.Error().Fields(msg).Msg("unknown level") } diff --git a/managedplugin/metrics.go b/managedplugin/metrics.go new file mode 100644 index 00000000..b14c5f52 --- /dev/null +++ b/managedplugin/metrics.go @@ -0,0 +1,16 @@ +package managedplugin + +import "sync/atomic" + +type Metrics struct { + Errors uint64 + Warnings uint64 +} + +func (m *Metrics) incrementErrors() { + atomic.AddUint64(&m.Errors, 1) +} + +func (m *Metrics) incrementWarnings() { + atomic.AddUint64(&m.Warnings, 1) +} diff --git a/managedplugin/plugin.go b/managedplugin/plugin.go index b7e55184..523bc41e 100644 --- a/managedplugin/plugin.go +++ b/managedplugin/plugin.go @@ -48,6 +48,7 @@ type Client struct { Conn *grpc.ClientConn config Config noSentry bool + metrics *Metrics } type Option func(*Client) @@ -109,6 +110,7 @@ func NewClient(ctx context.Context, config Config, opts ...Option) (*Client, err directory: defaultDownloadDir, wg: &sync.WaitGroup{}, config: config, + metrics: &Metrics{}, } for _, opt := range opts { opt(&c) @@ -149,6 +151,10 @@ func NewClient(ctx context.Context, config Config, opts ...Option) (*Client, err return &c, nil } +func (c *Client) Metrics() Metrics { + return *c.metrics +} + func (c *Client) startLocal(ctx context.Context, path string) error { c.grpcSocketName = GenerateRandomUnixSocketName() // spawn the plugin first and then connect @@ -191,7 +197,7 @@ func (c *Client) startLocal(ctx context.Context, path string) error { if err := json.Unmarshal(line, &structuredLogLine); err != nil { c.logger.Err(err).Str("line", string(line)).Msg("failed to unmarshal log line from destination plugin") } else { - JSONToLog(c.logger, structuredLogLine) + c.jsonToLog(c.logger, structuredLogLine) } } }()