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/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/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..cf692af7 --- /dev/null +++ b/managedplugin/logging.go @@ -0,0 +1,24 @@ +package managedplugin + +import "github.com/rs/zerolog" + +func (c *Client) 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("") + 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 new file mode 100644 index 00000000..523bc41e --- /dev/null +++ b/managedplugin/plugin.go @@ -0,0 +1,339 @@ +package managedplugin + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net" + "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" + "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 + metrics *Metrics +} + +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, + metrics: &Metrics{}, + } + 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", "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 + } + if err := c.startLocal(ctx, c.LocalPath); err != nil { + return nil, 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 + 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 { + c.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) 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{}) + 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/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.pb.go b/pb/discovery/v1/discovery.pb.go new file mode 100644 index 00000000..08743aeb --- /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 []int32 `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() []int32 { + 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, 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, + 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..bc2a66b5 --- /dev/null +++ b/pb/plugin/v3/plugin.pb.go @@ -0,0 +1,2009 @@ +// 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 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[1].Descriptor() +} + +func (PK_MODE) Type() protoreflect.EnumType { + return &file_plugin_pb_plugin_v3_plugin_proto_enumTypes[1] +} + +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{1} +} + +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 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 MessageMigrateTable 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 *MessageMigrateTable) Reset() { + *x = MessageMigrateTable{} + 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 *MessageMigrateTable) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageMigrateTable) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageMigrateTable.ProtoReflect.Descriptor instead. +func (*MessageMigrateTable) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{6} +} + +func (x *MessageMigrateTable) GetTable() []byte { + if x != nil { + return x.Table + } + return nil +} + +func (x *MessageMigrateTable) 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[7] + 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[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 MessageInsert.ProtoReflect.Descriptor instead. +func (*MessageInsert) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{7} +} + +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[8] + 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[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 MessageDeleteStale.ProtoReflect.Descriptor instead. +func (*MessageDeleteStale) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{8} +} + +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[9] + 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[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 Sync.ProtoReflect.Descriptor instead. +func (*Sync) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9} +} + +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[10] + 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[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 Write.ProtoReflect.Descriptor instead. +func (*Write) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10} +} + +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[11] + 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[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 Close.ProtoReflect.Descriptor instead. +func (*Close) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{11} +} + +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[12] + 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[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_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[13] + 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[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 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[14] + 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[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_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[15] + 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[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 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[16] + 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[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_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[17] + 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[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 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[18] + 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[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_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[19] + 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[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 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"` + 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[20] + 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[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_Request.ProtoReflect.Descriptor instead. +func (*Sync_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 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) 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_MigrateTable + // *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[21] + 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[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 Sync_Response.ProtoReflect.Descriptor instead. +func (*Sync_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{9, 1} +} + +func (m *Sync_Response) GetMessage() isSync_Response_Message { + if m != nil { + return m.Message + } + return nil +} + +func (x *Sync_Response) GetMigrateTable() *MessageMigrateTable { + if x, ok := x.GetMessage().(*Sync_Response_MigrateTable); ok { + return x.MigrateTable + } + 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_MigrateTable struct { + MigrateTable *MessageMigrateTable `protobuf:"bytes,1,opt,name=migrate_table,json=migrateTable,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_MigrateTable) 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_Options + // *Write_Request_MigrateTable + // *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[22] + 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[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_Request.ProtoReflect.Descriptor instead. +func (*Write_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 0} +} + +func (m *Write_Request) GetMessage() isWrite_Request_Message { + if m != nil { + return m.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) GetMigrateTable() *MessageMigrateTable { + if x, ok := x.GetMessage().(*Write_Request_MigrateTable); ok { + return x.MigrateTable + } + 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_Options struct { + Options *WriteOptions `protobuf:"bytes,1,opt,name=options,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 { + Insert *MessageInsert `protobuf:"bytes,3,opt,name=insert,proto3,oneof"` +} + +type Write_Request_Delete struct { + Delete *MessageDeleteStale `protobuf:"bytes,4,opt,name=delete,proto3,oneof"` +} + +func (*Write_Request_Options) isWrite_Request_Message() {} + +func (*Write_Request_MigrateTable) 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[23] + 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[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 Write_Response.ProtoReflect.Descriptor instead. +func (*Write_Response) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{10, 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[24] + 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[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_Request.ProtoReflect.Descriptor instead. +func (*Close_Request) Descriptor() ([]byte, []int) { + return file_plugin_pb_plugin_v3_plugin_proto_rawDescGZIP(), []int{11, 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[25] + 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[25] + 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{11, 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, 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, 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, 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, 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, + 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, 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, 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, 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 + (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 + 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() } +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.(*WriteOptions); 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.(*MessageMigrateTable); 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.(*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[8].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[9].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[10].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[11].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[12].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[13].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[14].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[15].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[16].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[17].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[18].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[19].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[20].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[21].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[22].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[23].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[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 + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_plugin_pb_plugin_v3_plugin_proto_msgTypes[21].OneofWrappers = []interface{}{ + (*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_MigrateTable)(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: 2, + NumMessages: 26, + 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/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)) 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/registry.go b/specs/v0/registry.go similarity index 99% rename from specs/registry.go rename to specs/v0/registry.go index b18bf3bc..6fd3c470 100644 --- a/specs/registry.go +++ b/specs/v0/registry.go @@ -17,6 +17,7 @@ const ( func (r Registry) String() string { return [...]string{"github", "local", "grpc"}[r] } + func (r Registry) MarshalJSON() ([]byte, error) { buffer := bytes.NewBufferString(`"`) buffer.WriteString(r.String()) 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/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