From e0a8d7a7cc9311c42bbcaed9c8d750bf1116bfc9 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 27 Dec 2023 13:02:52 +0100 Subject: [PATCH 01/17] Use Protocol Buffers to serialize and deserialize commands and responses --- Makefile | 7 + command.go | 99 + errors.go | 34 + go.mod | 77 +- go.sum | 179 +- internal/proto/buf.gen.yaml | 12 + internal/proto/buf.lock | 8 + internal/proto/buf.yaml | 14 + internal/proto/command_protobuf_test.go | 207 ++ internal/proto/errors.go | 22 + internal/proto/from_proto.go | 211 ++ internal/proto/processor/v1/processor.pb.go | 1967 +++++++++++++++++ internal/proto/processor/v1/processor.proto | 146 ++ internal/proto/to_proto.go | 254 +++ .../command_actions.go} | 46 +- internal/{wasm_imports.go => wasm/imports.go} | 2 +- .../imports_stub.go} | 4 +- internal/{wasm_memory.go => wasm/memory.go} | 5 +- mock/processor.go | 5 +- processor.go | 2 +- run.go => run/run.go | 32 +- serde/serde.go | 30 + tools.go | 1 + 23 files changed, 3265 insertions(+), 99 deletions(-) create mode 100644 command.go create mode 100644 errors.go create mode 100644 internal/proto/buf.gen.yaml create mode 100644 internal/proto/buf.lock create mode 100644 internal/proto/buf.yaml create mode 100644 internal/proto/command_protobuf_test.go create mode 100644 internal/proto/errors.go create mode 100644 internal/proto/from_proto.go create mode 100644 internal/proto/processor/v1/processor.pb.go create mode 100644 internal/proto/processor/v1/processor.proto create mode 100644 internal/proto/to_proto.go rename internal/{wasm_commands.go => wasm/command_actions.go} (59%) rename internal/{wasm_imports.go => wasm/imports.go} (98%) rename internal/{wasm_imports_stub.go => wasm/imports_stub.go} (95%) rename internal/{wasm_memory.go => wasm/memory.go} (92%) rename run.go => run/run.go (62%) create mode 100644 serde/serde.go diff --git a/Makefile b/Makefile index a4ab857..ee3feb3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +.PHONY: default +default: fmt lint test + .PHONY: test test: go test $(GOTEST_FLAGS) -race ./... -tags !wasm @@ -19,3 +22,7 @@ install-tools: .PHONY: generate generate: go generate ./... + +.PHONY: proto-generate +proto-generate: + cd internal/proto && buf generate diff --git a/command.go b/command.go new file mode 100644 index 0000000..d1a8389 --- /dev/null +++ b/command.go @@ -0,0 +1,99 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sdk + +import ( + "context" + + "github.com/conduitio/conduit-commons/opencdc" +) + +type Command interface { + Execute(context.Context, Processor) CommandResponse +} + +type CommandResponse interface { + isCommandResponse() +} + +type SpecifyCmd struct{} + +func (c *SpecifyCmd) Execute(_ context.Context, plugin Processor) CommandResponse { + spec, err := plugin.Specification() + return &SpecifyResponse{Specification: spec, Err: err} +} + +type SpecifyResponse struct { + Specification Specification + Err error +} + +func (r *SpecifyResponse) isCommandResponse() {} + +type ConfigureCmd struct { + ConfigMap map[string]string +} + +func (c *ConfigureCmd) Execute(ctx context.Context, p Processor) CommandResponse { + return &ConfigureResponse{ + Err: p.Configure(ctx, c.ConfigMap), + } +} + +type ConfigureResponse struct { + Err error +} + +func (r *ConfigureResponse) isCommandResponse() {} + +type OpenCmd struct{} + +func (c *OpenCmd) Execute(ctx context.Context, p Processor) CommandResponse { + return &OpenResponse{Err: p.Open(ctx)} +} + +type OpenResponse struct { + Err error +} + +func (r *OpenResponse) isCommandResponse() {} + +type ProcessCmd struct { + Records []opencdc.Record +} + +func (c *ProcessCmd) Execute(ctx context.Context, plugin Processor) CommandResponse { + return &ProcessResponse{Records: plugin.Process(ctx, c.Records)} +} + +type ProcessResponse struct { + Records []ProcessedRecord +} + +func (r *ProcessResponse) isCommandResponse() {} + +type TeardownCmd struct{} + +func (c *TeardownCmd) Execute(ctx context.Context, p Processor) CommandResponse { + return &TeardownResponse{ + Err: p.Teardown(ctx), + } +} + +type TeardownResponse struct { + Err error +} + +func (r *TeardownResponse) isCommandResponse() {} diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..9382330 --- /dev/null +++ b/errors.go @@ -0,0 +1,34 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sdk + +import ( + "errors" + "math" +) + +var ( + // ErrorCodeStart is the smallest error code which the host (i.e. Conduit) can send. + // The imported function _nextCommand returns an uint32 value + // that is either the number of bytes actually written or an error code. + // Because of that, we're reserving a range of error codes. + ErrorCodeStart = ErrMemoryOutOfRange + + ErrCodeInsufficientSize = math.MaxUint32 - uint32(1) + ErrCodeFailedGettingCommand = math.MaxUint32 - uint32(2) + ErrMemoryOutOfRange = math.MaxUint32 - uint32(3) +) + +var ErrNextCommand = errors.New("failed getting next command") diff --git a/go.mod b/go.mod index d71c4de..e5dc224 100644 --- a/go.mod +++ b/go.mod @@ -5,30 +5,39 @@ go 1.21.1 toolchain go1.21.5 require ( - github.com/conduitio/conduit-commons v0.0.0-20231205181721-bef91d55116c - github.com/goccy/go-json v0.10.2 + github.com/bufbuild/buf v1.28.1 + github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45 github.com/golangci/golangci-lint v1.55.2 + github.com/matryer/is v1.4.1 go.uber.org/mock v0.4.0 + google.golang.org/protobuf v1.32.0 mvdan.cc/gofumpt v0.5.0 ) require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2 // indirect + buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231111212044-1119bf4b707e.2 // indirect + connectrpc.com/connect v1.12.0 // indirect + connectrpc.com/otelconnect v0.6.0 // indirect github.com/4meepo/tagalign v1.3.3 // indirect github.com/Abirdcfly/dupword v0.0.13 // indirect github.com/Antonboom/errname v0.1.12 // indirect github.com/Antonboom/nilnil v0.1.7 // indirect github.com/Antonboom/testifylint v0.2.3 // indirect + github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.3.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect github.com/alecthomas/go-check-sumtype v0.1.3 // indirect github.com/alexkohler/nakedret/v2 v2.0.2 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alingse/asasalint v0.0.11 // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -37,6 +46,8 @@ require ( github.com/bombsimon/wsl/v3 v3.4.0 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect + github.com/bufbuild/protocompile v0.6.1-0.20231108163138-146b831231f7 // indirect + github.com/bufbuild/protovalidate-go v0.4.1 // indirect github.com/butuzov/ireturn v0.2.2 // indirect github.com/butuzov/mirror v1.1.0 // indirect github.com/catenacyber/perfsprint v0.2.0 // indirect @@ -44,19 +55,32 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect + github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.11.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/distribution/reference v0.5.0 // indirect + github.com/docker/cli v24.0.7+incompatible // indirect + github.com/docker/distribution v2.8.3+incompatible // indirect + github.com/docker/docker v24.0.7+incompatible // indirect + github.com/docker/docker-credential-helpers v0.8.0 // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/esimonov/ifshort v1.0.4 // indirect github.com/ettle/strcase v0.1.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structtag v1.2.0 // indirect + github.com/felixge/fgprof v0.9.3 // indirect github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.2.3 // indirect + github.com/go-chi/chi/v5 v5.0.10 // indirect github.com/go-critic/go-critic v0.9.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect github.com/go-toolsmith/astequal v1.1.0 // indirect @@ -66,8 +90,11 @@ require ( github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/gofrs/flock v0.8.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/gofrs/uuid/v5 v5.0.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect @@ -77,7 +104,10 @@ require ( github.com/golangci/misspell v0.4.1 // indirect github.com/golangci/revgrep v0.5.2 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect + github.com/google/cel-go v0.18.2 // indirect github.com/google/go-cmp v0.6.0 // indirect + github.com/google/go-containerregistry v0.16.1 // indirect + github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a // indirect github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect @@ -89,6 +119,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jdx/go-netrc v1.0.0 // indirect github.com/jgautheron/goconst v1.6.0 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect @@ -96,6 +127,8 @@ require ( github.com/kisielk/errcheck v1.6.3 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kkHAIKE/contextcheck v1.1.4 // indirect + github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/pgzip v1.2.6 // indirect github.com/kulti/thelper v0.6.3 // indirect github.com/kunwardeep/paralleltest v1.0.8 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect @@ -116,14 +149,21 @@ require ( github.com/mgechev/revive v1.3.4 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/moricho/tparallel v0.3.1 // indirect + github.com/morikuni/aec v1.0.0 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.11.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/nunnatsa/ginkgolinter v0.14.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opencontainers/go-digest v1.0.0 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pkg/profile v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/polyfloyd/go-errorlint v1.4.5 // indirect github.com/prometheus/client_golang v1.12.1 // indirect @@ -134,6 +174,8 @@ require ( github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect + github.com/rs/cors v1.10.1 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect @@ -149,18 +191,20 @@ require ( github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.7.0 // indirect + github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.12.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect + github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/stretchr/testify v1.8.4 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tetafro/godot v1.4.15 // indirect + github.com/tetratelabs/wazero v1.5.0 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect @@ -168,24 +212,33 @@ require ( github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.0.5 // indirect github.com/uudashr/gocognit v1.1.2 // indirect + github.com/vbatts/tar-split v0.11.5 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.2.0 // indirect github.com/ykadowak/zerologlint v0.1.3 // indirect gitlab.com/bosi/decorder v0.4.1 // indirect go-simpler.org/sloglint v0.1.2 // indirect + go.opentelemetry.io/otel v1.20.0 // indirect + go.opentelemetry.io/otel/metric v1.20.0 // indirect + go.opentelemetry.io/otel/sdk v1.20.0 // indirect + go.opentelemetry.io/otel/trace v1.20.0 // indirect go.tmz.dev/musttag v0.7.2 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect + go.uber.org/atomic v1.11.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + go.uber.org/zap v1.26.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/tools v0.16.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.16.1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 7c8bb2d..ab58f75 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,11 @@ 4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= 4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20230914171853-63dfe56cc2c4.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2 h1:iRWpWLm1nrsCHBVhibqPJQB3iIf3FRsAXioJVU8m6w0= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231111212044-1119bf4b707e.2 h1:tgXOEZtPifMR5kaQ6GB4t7pk0G3dai/OS3JFD9Zt+eE= +buf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.31.0-20231111212044-1119bf4b707e.2/go.mod h1:3Ion4eJWjUDfJyrUXSgtB3zO5ZweZtyvNuEc+fyMBCk= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -39,6 +44,10 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= +connectrpc.com/connect v1.12.0 h1:HwKdOY0lGhhoHdsza+hW55aqHEC64pYpObRNoAgn70g= +connectrpc.com/connect v1.12.0/go.mod h1:3AGaO6RRGMx5IKFfqbe3hvK1NqLosFNP2BxDYTPmNPo= +connectrpc.com/otelconnect v0.6.0 h1:VJAdQL9+sgdUw9+7+J+jq8pQo/h1S7tSFv2+vDcR7bU= +connectrpc.com/otelconnect v0.6.0/go.mod h1:jdcs0uiwXQVmSMgTJ2dAaWR5VbpNd7QKNkuoH7n86RA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= @@ -50,6 +59,8 @@ github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTo github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= github.com/Antonboom/testifylint v0.2.3 h1:MFq9zyL+rIVpsvLX4vDPLojgN7qODzWsrnftNX2Qh60= github.com/Antonboom/testifylint v0.2.3/go.mod h1:IYaXaOX9NbfAyO+Y04nfjGI8wDemC1rUyM/cYolz018= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= +github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -60,6 +71,8 @@ github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 h1:3ZBs7LAezy8gh0uECsA6C github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0/go.mod h1:rZLTje5A9kFBe0pzhpe2TdhRniBF++PRHQuRpR8esVc= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= @@ -79,12 +92,12 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -99,6 +112,12 @@ github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= +github.com/bufbuild/buf v1.28.1 h1:JG+PjhaVz4bprGV1u//ZBDSxWwFnjrzjse2pmm4zBlI= +github.com/bufbuild/buf v1.28.1/go.mod h1:X/HDGbWUM2QiR5XvvsBfElUPblETOf96zq5H7FOUiP4= +github.com/bufbuild/protocompile v0.6.1-0.20231108163138-146b831231f7 h1:1pUks8VaLdprN9wrxAgshb06b08IzdYp0B7JgoDeUfw= +github.com/bufbuild/protocompile v0.6.1-0.20231108163138-146b831231f7/go.mod h1:9N39DyRmxAF5+5AjqXQKV6hyWDI0EeoX4TRMix2ZnPE= +github.com/bufbuild/protovalidate-go v0.4.1 h1:ye/8S72WbEklCeltPkSEeT8Eu1A7P/gmMsmapkwqTFk= +github.com/bufbuild/protovalidate-go v0.4.1/go.mod h1:+p5FXfOjSEgLz5WBDTOMPMdQPXqALEERbJZU7huDCtA= github.com/butuzov/ireturn v0.2.2 h1:jWI36dxXwVrI+RnXDwux2IZOewpmfv930OuIRfaBUJ0= github.com/butuzov/ireturn v0.2.2/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= @@ -122,9 +141,14 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/conduitio/conduit-commons v0.0.0-20231205181721-bef91d55116c h1:iggz0i/MMCHo7FINL01hDUgRhDCLrcSMzIqaiaRCNmg= -github.com/conduitio/conduit-commons v0.0.0-20231205181721-bef91d55116c/go.mod h1:d4Q4/ezToUpMs8d4hk5z3XkcIV0BTrEpEHFecdP0kLs= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45 h1:GJhyDjoyswfJdqKyszQvevOw/xAz6ilNgN8q6T0lDeQ= +github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45/go.mod h1:+bKjNjWYkbc/MMkBFSzND09FxpPD3GqjmPRQMndkvZ0= +github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= +github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y= @@ -134,12 +158,28 @@ 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/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= +github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= +github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= +github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= +github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= +github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= @@ -148,6 +188,8 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= +github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= @@ -158,6 +200,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghostiam/protogetter v0.2.3 h1:qdv2pzo3BpLqezwqfGDLZ+nHEYmc5bUpIdsMbBVwMjw= github.com/ghostiam/protogetter v0.2.3/go.mod h1:KmNLOsy1v04hKbvZs8EfGI1fk39AgTdRDxWNYPfXVc4= +github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= +github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-critic/go-critic v0.9.0 h1:Pmys9qvU3pSML/3GEQ2Xd9RZ/ip+aXHKILuxczKGV/U= github.com/go-critic/go-critic v0.9.0/go.mod h1:5P8tdXL7m/6qnyG6oRAlYLORvoXH0WDypYgAEmagT40= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -169,8 +213,11 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= -github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= @@ -200,7 +247,11 @@ github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= +github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -227,8 +278,9 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= @@ -251,6 +303,8 @@ github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSW github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/cel-go v0.18.2 h1:L0B6sNBSVmt0OyECi8v6VOS74KOc9W/tLiWKfZABvf4= +github.com/google/cel-go v0.18.2/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -265,6 +319,8 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-containerregistry v0.16.1 h1:rUEt426sR6nyrL3gt+18ibRcvYpKYdpsa5ZW7MA08dQ= +github.com/google/go-containerregistry v0.16.1/go.mod h1:u0qB2l7mvtWVR5kNcbFIhFY1hLbf8eeGapA+vbFDCtQ= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -279,8 +335,9 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= +github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a h1:fEBsGL/sjAuJrgah5XqmmYsTLzJp/TO9Lhy39gkverk= +github.com/google/pprof v0.0.0-20231101202521-4ca4178f5c7a/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -315,10 +372,15 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= +github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= github.com/jgautheron/goconst v1.6.0 h1:gbMLWKRMkzAc6kYsQL6/TxaoBUg3Jm9LSF/Ih1ADWGA= github.com/jgautheron/goconst v1.6.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jhump/protoreflect v1.15.3 h1:6SFRuqU45u9hIZPJAoZ8c28T3nK64BNdp9w6jFonzls= +github.com/jhump/protoreflect v1.15.3/go.mod h1:4ORHmSBmlCW8fh3xHmJMGyul1zNqZK4Elxc8qKP+p1k= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= @@ -334,12 +396,17 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= +github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= +github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= +github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -395,6 +462,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -402,12 +471,12 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8pzda2l0= github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= @@ -420,6 +489,10 @@ github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4 github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc= github.com/otiai10/copy v1.11.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= @@ -431,10 +504,14 @@ github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3v github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= +github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -473,6 +550,9 @@ github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= +github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= @@ -509,8 +589,8 @@ github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -521,6 +601,8 @@ github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YE github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= +github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -533,6 +615,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= @@ -547,6 +630,8 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.15 h1:QzdIs+XB8q+U1WmQEWKHQbKmCw06QuQM7gLx/dky2RM= github.com/tetafro/godot v1.4.15/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0= +github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= @@ -561,6 +646,8 @@ github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqz github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= +github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= +github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= @@ -588,18 +675,28 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= +go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= +go.opentelemetry.io/otel/metric v1.20.0 h1:ZlrO8Hu9+GAhnepmRGhSU7/VkpjrNowxRN9GyKR4wzA= +go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= +go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= +go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= +go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= +go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= +go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -610,6 +707,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -620,8 +719,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4= -golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ= @@ -771,6 +870,9 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -784,14 +886,16 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -803,11 +907,13 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -850,6 +956,7 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -862,6 +969,7 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= @@ -876,8 +984,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= 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= @@ -944,6 +1052,10 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3 h1:kzJAXnzZoFbe5bhZd4zjUuHos/I31yH4thfMb/13oVY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231211222908-989df2bf70f3/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -972,14 +1084,15 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -993,6 +1106,8 @@ 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= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/internal/proto/buf.gen.yaml b/internal/proto/buf.gen.yaml new file mode 100644 index 0000000..c8daba0 --- /dev/null +++ b/internal/proto/buf.gen.yaml @@ -0,0 +1,12 @@ +version: v1 +managed: + enabled: true + go_package_prefix: + default: "github.com/conduitio/conduit-processor-sdk/internal/proto" + except: + - buf.build/haris/conduit-commons +plugins: + - plugin: buf.build/protocolbuffers/go:v1.31.0 + out: . + opt: + - paths=source_relative diff --git a/internal/proto/buf.lock b/internal/proto/buf.lock new file mode 100644 index 0000000..326e7c6 --- /dev/null +++ b/internal/proto/buf.lock @@ -0,0 +1,8 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: haris + repository: conduit-commons + commit: f9ca4999fb9445959d78b9f627bf8d19 + digest: shake256:93c24c6a3816c3812533c16ad455b3e948ee7581692652fbc88d1b5c87e15453733d93b5c644576b081bb0db96f01a43365bf6811c5736aaccfeea74c1911a0a diff --git a/internal/proto/buf.yaml b/internal/proto/buf.yaml new file mode 100644 index 0000000..cd91f86 --- /dev/null +++ b/internal/proto/buf.yaml @@ -0,0 +1,14 @@ +version: v1 +name: buf.build/conduitio/conduit-processor-sdk +deps: + - buf.build/haris/conduit-commons:v0.1.3 +lint: + service_suffix: Plugin + use: + - DEFAULT + except: + - RPC_REQUEST_STANDARD_NAME + - RPC_RESPONSE_STANDARD_NAME +breaking: + use: + - FILE diff --git a/internal/proto/command_protobuf_test.go b/internal/proto/command_protobuf_test.go new file mode 100644 index 0000000..857b610 --- /dev/null +++ b/internal/proto/command_protobuf_test.go @@ -0,0 +1,207 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package proto + +import ( + "errors" + "testing" + + "github.com/conduitio/conduit-commons/opencdc" + sdk "github.com/conduitio/conduit-processor-sdk" + "github.com/matryer/is" +) + +func TestCommand_Marshal_Unmarshal(t *testing.T) { + is := is.New(t) + + testCases := []struct { + name string + input sdk.Command + }{ + { + name: "specify", + input: &sdk.SpecifyCmd{}, + }, + { + name: "configure", + input: &sdk.ConfigureCmd{ + ConfigMap: map[string]string{ + "url": "https://conduit.io", + }, + }, + }, + { + name: "open", + input: &sdk.OpenCmd{}, + }, + { + name: "process with no records", + input: &sdk.ProcessCmd{}, + }, + { + name: "process with records", + input: &sdk.ProcessCmd{ + Records: []opencdc.Record{ + { + Position: opencdc.Position("test-post"), + Operation: opencdc.OperationCreate, + Metadata: opencdc.Metadata{ + "meta1": "v1", + }, + Key: opencdc.RawData("test-key"), + Payload: opencdc.Change{ + After: opencdc.StructuredData{ + "key1": "value1", + }, + }, + }, + }, + }, + }, + { + name: "teardown", + input: &sdk.TeardownCmd{}, + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + bytes, err := MarshalCommand(tt.input) + is.NoErr(err) + + cmd, err := UnmarshalCommand(bytes) + is.NoErr(err) + is.Equal(tt.input, cmd) + }) + } +} + +func TestCommandResponse_Marshal_Unmarshal(t *testing.T) { + is := is.New(t) + + testCases := []struct { + name string + input sdk.CommandResponse + }{ + { + name: "specify", + input: &sdk.SpecifyResponse{ + Specification: sdk.Specification{ + Name: "test-connector", + Summary: "A test connector", + Description: "A test connector", + Version: "v2.3.4", + Author: "Conduit", + Parameters: map[string]sdk.Parameter{ + "required-param": { + Default: "", + Type: sdk.ParameterTypeString, + Description: "Service URL", + Validations: []sdk.Validation{ + { + Type: sdk.ValidationTypeRequired, + }, + }, + }, + "duration-param": { + Default: "1m", + Type: sdk.ParameterTypeDuration, + Description: "Timeout", + Validations: nil, + }, + "inclusion-param": { + Default: "snapshot", + Type: sdk.ParameterTypeDuration, + Description: "Timeout", + Validations: []sdk.Validation{ + { + Type: sdk.ValidationTypeInclusion, + Value: "snapshot,cdc", + }, + }, + }, + }, + }, + }, + }, + { + name: "specify with error", + input: &sdk.SpecifyResponse{ + Err: errors.New("specify error"), + }, + }, + { + name: "configure", + input: &sdk.ConfigureResponse{}, + }, + { + name: "configure with error", + input: &sdk.ConfigureResponse{ + Err: errors.New("configure error"), + }, + }, + { + name: "open", + input: &sdk.OpenResponse{ + Err: errors.New("open error"), + }, + }, + { + name: "process response with no records", + input: &sdk.ProcessResponse{}, + }, + { + name: "process with records", + input: &sdk.ProcessResponse{ + Records: []sdk.ProcessedRecord{ + sdk.SingleRecord{ + Position: opencdc.Position("test-post"), + Operation: opencdc.OperationCreate, + Metadata: opencdc.Metadata{ + "meta1": "v1", + }, + Key: opencdc.RawData("test-key"), + Payload: opencdc.Change{ + After: opencdc.StructuredData{ + "key1": "value1", + }, + }, + }, + }, + }, + }, + { + name: "teardown", + input: &sdk.TeardownResponse{}, + }, + { + name: "teardown with error", + input: &sdk.TeardownResponse{ + Err: errors.New("teardown error"), + }, + }, + } + + for _, tt := range testCases { + t.Run(tt.name, func(t *testing.T) { + bytes, err := MarshalCommandResponse(tt.input) + is.NoErr(err) + + got, err := UnmarshalCommandResponse(bytes) + is.NoErr(err) + is.Equal(tt.input, got) + }) + } +} diff --git a/internal/proto/errors.go b/internal/proto/errors.go new file mode 100644 index 0000000..e9ece46 --- /dev/null +++ b/internal/proto/errors.go @@ -0,0 +1,22 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package proto + +import "errors" + +var ( + ErrNilCommand = errors.New("command is nil") + ErrUnknownType = errors.New("unknown type") +) diff --git a/internal/proto/from_proto.go b/internal/proto/from_proto.go new file mode 100644 index 0000000..9d181e7 --- /dev/null +++ b/internal/proto/from_proto.go @@ -0,0 +1,211 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package proto + +import ( + "errors" + "fmt" + + "github.com/conduitio/conduit-commons/opencdc" + opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" + sdk "github.com/conduitio/conduit-processor-sdk" + processorv1 "github.com/conduitio/conduit-processor-sdk/internal/proto/processor/v1" + "google.golang.org/protobuf/proto" +) + +func UnmarshalCommand(bytes []byte) (sdk.Command, error) { + protoCmd := &processorv1.Command{} + if err := proto.Unmarshal(bytes, protoCmd); err != nil { + return nil, fmt.Errorf("failed unmarshalling %v proto bytes into a command: %w", len(bytes), err) + } + + return sdkCommand(protoCmd) +} + +func sdkCommand(cmd *processorv1.Command) (sdk.Command, error) { + c := cmd.GetCommand() + if c == nil { + return nil, ErrNilCommand + } + + switch v := c.(type) { + case *processorv1.Command_SpecifyCmd: + return &sdk.SpecifyCmd{}, nil + case *processorv1.Command_ConfigureCmd: + return &sdk.ConfigureCmd{ConfigMap: v.ConfigureCmd.Parameters}, nil + case *processorv1.Command_OpenCmd: + return &sdk.OpenCmd{}, nil + case *processorv1.Command_ProcessCmd: + records, err := opencdcRecords(v.ProcessCmd.Records) + if err != nil { + return nil, err + } + return &sdk.ProcessCmd{ + Records: records, + }, nil + case *processorv1.Command_TeardownCmd: + return &sdk.TeardownCmd{}, nil + default: + return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) + } +} + +func UnmarshalCommandResponse(bytes []byte) (sdk.CommandResponse, error) { + protoCmd := &processorv1.CommandResponse{} + if err := proto.Unmarshal(bytes, protoCmd); err != nil { + return nil, fmt.Errorf("failed unmarshalling proto bytes: %w", err) + } + + return sdkCommandResponse(protoCmd) +} + +func sdkCommandResponse(cr *processorv1.CommandResponse) (sdk.CommandResponse, error) { + resp := cr.GetResponse() + if resp == nil { + return nil, ErrNilCommand + } + + switch v := resp.(type) { + case *processorv1.CommandResponse_SpecifyResp: + return &sdk.SpecifyResponse{ + Specification: sdkSpec(v.SpecifyResp), + Err: errorFromString(v.SpecifyResp.Err), + }, nil + case *processorv1.CommandResponse_ConfigureResp: + return &sdk.ConfigureResponse{ + Err: errorFromString(v.ConfigureResp.Err), + }, nil + case *processorv1.CommandResponse_OpenResp: + return &sdk.OpenResponse{ + Err: errorFromString(v.OpenResp.Err), + }, nil + case *processorv1.CommandResponse_ProcessResp: + records, err := sdkProcessedRecord(v.ProcessResp.Records) + if err != nil { + return nil, err + } + return &sdk.ProcessResponse{ + Records: records, + }, nil + case *processorv1.CommandResponse_TeardownResp: + return &sdk.TeardownResponse{ + Err: errorFromString(v.TeardownResp.Err), + }, nil + default: + return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) + } +} + +func errorFromString(s string) error { + if s == "" { + return nil + } + + return errors.New(s) //nolint:goerr113 // the only way to deal with errors with protobuf +} + +func sdkProcessedRecord(in []*processorv1.Process_ProcessedRecord) ([]sdk.ProcessedRecord, error) { + if in == nil { + return nil, nil + } + + out := make([]sdk.ProcessedRecord, len(in)) + for i, r := range in { + switch v := r.GetRecord().(type) { + case *processorv1.Process_ProcessedRecord_SingleRecord: + rec := opencdc.Record{} + err := rec.FromProto(v.SingleRecord) + if err != nil { + return nil, fmt.Errorf("failed converting proto record to OpenCDC record: %w", err) + } + out[i] = sdk.SingleRecord(rec) + case *processorv1.Process_ProcessedRecord_FilterRecord: + out[i] = sdk.FilterRecord{} + case *processorv1.Process_ProcessedRecord_ErrorRecord: + out[i] = sdk.ErrorRecord{ + //nolint:goerr113 // the only way to deal with errors with protobuf + Err: errors.New(v.ErrorRecord.Err), + } + default: + return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) + } + } + + return out, nil +} + +func sdkSpec(resp *processorv1.Specify_Response) sdk.Specification { + return sdk.Specification{ + Name: resp.Name, + Summary: resp.Summary, + Description: resp.Description, + Version: resp.Version, + Author: resp.Author, + Parameters: sdkSpecParams(resp.Parameters), + } +} + +func sdkSpecParams(in map[string]*processorv1.Specify_Parameter) map[string]sdk.Parameter { + if in == nil { + return nil + } + + out := make(map[string]sdk.Parameter, len(in)) + for name, param := range in { + out[name] = sdk.Parameter{ + Default: param.Default, + Type: sdk.ParameterType(param.Type), + Description: param.Description, + Validations: sdkParamValidations(param.Validations), + } + } + + return out +} + +func sdkParamValidations(in []*processorv1.Specify_Parameter_Validation) []sdk.Validation { + if in == nil { + return nil + } + + out := make([]sdk.Validation, len(in)) + for i, v := range in { + out[i] = sdk.Validation{ + Type: sdk.ValidationType(v.Type), + Value: v.Value, + } + } + + return out +} + +func opencdcRecords(in []*opencdcv1.Record) ([]opencdc.Record, error) { + if in == nil { + return nil, nil + } + + outRecs := make([]opencdc.Record, len(in)) + for i, protoRec := range in { + rec := opencdc.Record{} + err := rec.FromProto(protoRec) + if err != nil { + return nil, fmt.Errorf("failed converting protobuf record at index %v to OpenCDC record: %w", i, err) + } + + outRecs[i] = rec + } + + return outRecs, nil +} diff --git a/internal/proto/processor/v1/processor.pb.go b/internal/proto/processor/v1/processor.pb.go new file mode 100644 index 0000000..ceff6b3 --- /dev/null +++ b/internal/proto/processor/v1/processor.pb.go @@ -0,0 +1,1967 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: processor/v1/processor.proto + +package processorv1 + +import ( + v1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" + 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 shows the parameter type. +type Specify_Parameter_Type int32 + +const ( + Specify_Parameter_TYPE_UNSPECIFIED Specify_Parameter_Type = 0 + // Parameter is a string. + Specify_Parameter_TYPE_STRING Specify_Parameter_Type = 1 + // Parameter is an integer. + Specify_Parameter_TYPE_INT Specify_Parameter_Type = 2 + // Parameter is a float. + Specify_Parameter_TYPE_FLOAT Specify_Parameter_Type = 3 + // Parameter is a boolean. + Specify_Parameter_TYPE_BOOL Specify_Parameter_Type = 4 + // Parameter is a file. + Specify_Parameter_TYPE_FILE Specify_Parameter_Type = 5 + // Parameter is a duration. + Specify_Parameter_TYPE_DURATION Specify_Parameter_Type = 6 +) + +// Enum value maps for Specify_Parameter_Type. +var ( + Specify_Parameter_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_STRING", + 2: "TYPE_INT", + 3: "TYPE_FLOAT", + 4: "TYPE_BOOL", + 5: "TYPE_FILE", + 6: "TYPE_DURATION", + } + Specify_Parameter_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_STRING": 1, + "TYPE_INT": 2, + "TYPE_FLOAT": 3, + "TYPE_BOOL": 4, + "TYPE_FILE": 5, + "TYPE_DURATION": 6, + } +) + +func (x Specify_Parameter_Type) Enum() *Specify_Parameter_Type { + p := new(Specify_Parameter_Type) + *p = x + return p +} + +func (x Specify_Parameter_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Specify_Parameter_Type) Descriptor() protoreflect.EnumDescriptor { + return file_processor_v1_processor_proto_enumTypes[0].Descriptor() +} + +func (Specify_Parameter_Type) Type() protoreflect.EnumType { + return &file_processor_v1_processor_proto_enumTypes[0] +} + +func (x Specify_Parameter_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Specify_Parameter_Type.Descriptor instead. +func (Specify_Parameter_Type) EnumDescriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 2, 0} +} + +type Specify_Parameter_Validation_Type int32 + +const ( + Specify_Parameter_Validation_TYPE_UNSPECIFIED Specify_Parameter_Validation_Type = 0 + // Parameter must be present. + Specify_Parameter_Validation_TYPE_REQUIRED Specify_Parameter_Validation_Type = 1 + // Parameter must be greater than {value}. + Specify_Parameter_Validation_TYPE_GREATER_THAN Specify_Parameter_Validation_Type = 2 + // Parameter must be less than {value}. + Specify_Parameter_Validation_TYPE_LESS_THAN Specify_Parameter_Validation_Type = 3 + // Parameter must be included in the comma separated list {value}. + Specify_Parameter_Validation_TYPE_INCLUSION Specify_Parameter_Validation_Type = 4 + // Parameter must not be included in the comma separated list {value}. + Specify_Parameter_Validation_TYPE_EXCLUSION Specify_Parameter_Validation_Type = 5 + // Parameter must match the regex {value}. + Specify_Parameter_Validation_TYPE_REGEX Specify_Parameter_Validation_Type = 6 +) + +// Enum value maps for Specify_Parameter_Validation_Type. +var ( + Specify_Parameter_Validation_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "TYPE_REQUIRED", + 2: "TYPE_GREATER_THAN", + 3: "TYPE_LESS_THAN", + 4: "TYPE_INCLUSION", + 5: "TYPE_EXCLUSION", + 6: "TYPE_REGEX", + } + Specify_Parameter_Validation_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "TYPE_REQUIRED": 1, + "TYPE_GREATER_THAN": 2, + "TYPE_LESS_THAN": 3, + "TYPE_INCLUSION": 4, + "TYPE_EXCLUSION": 5, + "TYPE_REGEX": 6, + } +) + +func (x Specify_Parameter_Validation_Type) Enum() *Specify_Parameter_Validation_Type { + p := new(Specify_Parameter_Validation_Type) + *p = x + return p +} + +func (x Specify_Parameter_Validation_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Specify_Parameter_Validation_Type) Descriptor() protoreflect.EnumDescriptor { + return file_processor_v1_processor_proto_enumTypes[1].Descriptor() +} + +func (Specify_Parameter_Validation_Type) Type() protoreflect.EnumType { + return &file_processor_v1_processor_proto_enumTypes[1] +} + +func (x Specify_Parameter_Validation_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Specify_Parameter_Validation_Type.Descriptor instead. +func (Specify_Parameter_Validation_Type) EnumDescriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 2, 0, 0} +} + +type Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Command: + // + // *Command_SpecifyCmd + // *Command_ConfigureCmd + // *Command_OpenCmd + // *Command_ProcessCmd + // *Command_TeardownCmd + Command isCommand_Command `protobuf_oneof:"command"` +} + +func (x *Command) Reset() { + *x = Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Command) ProtoMessage() {} + +func (x *Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Command.ProtoReflect.Descriptor instead. +func (*Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{0} +} + +func (m *Command) GetCommand() isCommand_Command { + if m != nil { + return m.Command + } + return nil +} + +func (x *Command) GetSpecifyCmd() *Specify_Command { + if x, ok := x.GetCommand().(*Command_SpecifyCmd); ok { + return x.SpecifyCmd + } + return nil +} + +func (x *Command) GetConfigureCmd() *Configure_Command { + if x, ok := x.GetCommand().(*Command_ConfigureCmd); ok { + return x.ConfigureCmd + } + return nil +} + +func (x *Command) GetOpenCmd() *Open_Command { + if x, ok := x.GetCommand().(*Command_OpenCmd); ok { + return x.OpenCmd + } + return nil +} + +func (x *Command) GetProcessCmd() *Process_Command { + if x, ok := x.GetCommand().(*Command_ProcessCmd); ok { + return x.ProcessCmd + } + return nil +} + +func (x *Command) GetTeardownCmd() *Teardown_Command { + if x, ok := x.GetCommand().(*Command_TeardownCmd); ok { + return x.TeardownCmd + } + return nil +} + +type isCommand_Command interface { + isCommand_Command() +} + +type Command_SpecifyCmd struct { + SpecifyCmd *Specify_Command `protobuf:"bytes,1,opt,name=specify_cmd,json=specifyCmd,proto3,oneof"` +} + +type Command_ConfigureCmd struct { + ConfigureCmd *Configure_Command `protobuf:"bytes,2,opt,name=configure_cmd,json=configureCmd,proto3,oneof"` +} + +type Command_OpenCmd struct { + OpenCmd *Open_Command `protobuf:"bytes,3,opt,name=open_cmd,json=openCmd,proto3,oneof"` +} + +type Command_ProcessCmd struct { + ProcessCmd *Process_Command `protobuf:"bytes,4,opt,name=process_cmd,json=processCmd,proto3,oneof"` +} + +type Command_TeardownCmd struct { + TeardownCmd *Teardown_Command `protobuf:"bytes,5,opt,name=teardown_cmd,json=teardownCmd,proto3,oneof"` +} + +func (*Command_SpecifyCmd) isCommand_Command() {} + +func (*Command_ConfigureCmd) isCommand_Command() {} + +func (*Command_OpenCmd) isCommand_Command() {} + +func (*Command_ProcessCmd) isCommand_Command() {} + +func (*Command_TeardownCmd) isCommand_Command() {} + +type CommandResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Response: + // + // *CommandResponse_SpecifyResp + // *CommandResponse_ConfigureResp + // *CommandResponse_OpenResp + // *CommandResponse_ProcessResp + // *CommandResponse_TeardownResp + Response isCommandResponse_Response `protobuf_oneof:"response"` +} + +func (x *CommandResponse) Reset() { + *x = CommandResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommandResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommandResponse) ProtoMessage() {} + +func (x *CommandResponse) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 CommandResponse.ProtoReflect.Descriptor instead. +func (*CommandResponse) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{1} +} + +func (m *CommandResponse) GetResponse() isCommandResponse_Response { + if m != nil { + return m.Response + } + return nil +} + +func (x *CommandResponse) GetSpecifyResp() *Specify_Response { + if x, ok := x.GetResponse().(*CommandResponse_SpecifyResp); ok { + return x.SpecifyResp + } + return nil +} + +func (x *CommandResponse) GetConfigureResp() *Configure_Response { + if x, ok := x.GetResponse().(*CommandResponse_ConfigureResp); ok { + return x.ConfigureResp + } + return nil +} + +func (x *CommandResponse) GetOpenResp() *Open_Response { + if x, ok := x.GetResponse().(*CommandResponse_OpenResp); ok { + return x.OpenResp + } + return nil +} + +func (x *CommandResponse) GetProcessResp() *Process_Response { + if x, ok := x.GetResponse().(*CommandResponse_ProcessResp); ok { + return x.ProcessResp + } + return nil +} + +func (x *CommandResponse) GetTeardownResp() *Teardown_Response { + if x, ok := x.GetResponse().(*CommandResponse_TeardownResp); ok { + return x.TeardownResp + } + return nil +} + +type isCommandResponse_Response interface { + isCommandResponse_Response() +} + +type CommandResponse_SpecifyResp struct { + SpecifyResp *Specify_Response `protobuf:"bytes,1,opt,name=specify_resp,json=specifyResp,proto3,oneof"` +} + +type CommandResponse_ConfigureResp struct { + ConfigureResp *Configure_Response `protobuf:"bytes,2,opt,name=configure_resp,json=configureResp,proto3,oneof"` +} + +type CommandResponse_OpenResp struct { + OpenResp *Open_Response `protobuf:"bytes,3,opt,name=open_resp,json=openResp,proto3,oneof"` +} + +type CommandResponse_ProcessResp struct { + ProcessResp *Process_Response `protobuf:"bytes,4,opt,name=process_resp,json=processResp,proto3,oneof"` +} + +type CommandResponse_TeardownResp struct { + TeardownResp *Teardown_Response `protobuf:"bytes,5,opt,name=teardown_resp,json=teardownResp,proto3,oneof"` +} + +func (*CommandResponse_SpecifyResp) isCommandResponse_Response() {} + +func (*CommandResponse_ConfigureResp) isCommandResponse_Response() {} + +func (*CommandResponse_OpenResp) isCommandResponse_Response() {} + +func (*CommandResponse_ProcessResp) isCommandResponse_Response() {} + +func (*CommandResponse_TeardownResp) isCommandResponse_Response() {} + +type Specify struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Specify) Reset() { + *x = Specify{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify) ProtoMessage() {} + +func (x *Specify) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify.ProtoReflect.Descriptor instead. +func (*Specify) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2} +} + +type Configure struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Configure) Reset() { + *x = Configure{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Configure) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Configure) ProtoMessage() {} + +func (x *Configure) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Configure.ProtoReflect.Descriptor instead. +func (*Configure) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{3} +} + +type Open struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Open) Reset() { + *x = Open{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Open) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Open) ProtoMessage() {} + +func (x *Open) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Open.ProtoReflect.Descriptor instead. +func (*Open) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{4} +} + +type Process struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Process) Reset() { + *x = Process{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process) ProtoMessage() {} + +func (x *Process) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process.ProtoReflect.Descriptor instead. +func (*Process) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5} +} + +type Teardown struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Teardown) Reset() { + *x = Teardown{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Teardown) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Teardown) ProtoMessage() {} + +func (x *Teardown) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Teardown.ProtoReflect.Descriptor instead. +func (*Teardown) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{6} +} + +type Specify_Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Specify_Command) Reset() { + *x = Specify_Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify_Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify_Command) ProtoMessage() {} + +func (x *Specify_Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify_Command.ProtoReflect.Descriptor instead. +func (*Specify_Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 0} +} + +type Specify_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name is the name of the plugin. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Summary is a brief description of the plugin and what it does, + // ideally not longer than one sentence. + Summary string `protobuf:"bytes,2,opt,name=summary,proto3" json:"summary,omitempty"` + // Description is a longer form field, appropriate for README-like + // text that the author can provide for documentation about the + // usage of the plugin. + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + // Version string. Should follow semantic versioning and use the "v" + // prefix (e.g. v1.23.4). + Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` + // Author declares the entity that created or maintains this plugin. + Author string `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"` + // A map that describes parameters available for configuring the + // destination plugin. + Parameters map[string]*Specify_Parameter `protobuf:"bytes,6,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Err string `protobuf:"bytes,7,opt,name=err,proto3" json:"err,omitempty"` +} + +func (x *Specify_Response) Reset() { + *x = Specify_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify_Response) ProtoMessage() {} + +func (x *Specify_Response) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify_Response.ProtoReflect.Descriptor instead. +func (*Specify_Response) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 1} +} + +func (x *Specify_Response) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Specify_Response) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *Specify_Response) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Specify_Response) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *Specify_Response) GetAuthor() string { + if x != nil { + return x.Author + } + return "" +} + +func (x *Specify_Response) GetParameters() map[string]*Specify_Parameter { + if x != nil { + return x.Parameters + } + return nil +} + +func (x *Specify_Response) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +// Parameter describes a single config parameter. +type Specify_Parameter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Default is the default value of the parameter. If there is no default + // value use an empty string. + Default string `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"` + // Description explains what the parameter does and how to configure it. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // Type defines the parameter data type. + Type Specify_Parameter_Type `protobuf:"varint,3,opt,name=type,proto3,enum=processor.v1.Specify_Parameter_Type" json:"type,omitempty"` + // Validations are validations to be made on the parameter. + Validations []*Specify_Parameter_Validation `protobuf:"bytes,4,rep,name=validations,proto3" json:"validations,omitempty"` +} + +func (x *Specify_Parameter) Reset() { + *x = Specify_Parameter{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify_Parameter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify_Parameter) ProtoMessage() {} + +func (x *Specify_Parameter) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify_Parameter.ProtoReflect.Descriptor instead. +func (*Specify_Parameter) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 2} +} + +func (x *Specify_Parameter) GetDefault() string { + if x != nil { + return x.Default + } + return "" +} + +func (x *Specify_Parameter) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Specify_Parameter) GetType() Specify_Parameter_Type { + if x != nil { + return x.Type + } + return Specify_Parameter_TYPE_UNSPECIFIED +} + +func (x *Specify_Parameter) GetValidations() []*Specify_Parameter_Validation { + if x != nil { + return x.Validations + } + return nil +} + +// Validation to be made on the parameter. +type Specify_Parameter_Validation struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type Specify_Parameter_Validation_Type `protobuf:"varint,1,opt,name=type,proto3,enum=processor.v1.Specify_Parameter_Validation_Type" json:"type,omitempty"` + // The value to be compared with the parameter, + // or a comma separated list in case of Validation.TYPE_INCLUSION or Validation.TYPE_EXCLUSION. + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Specify_Parameter_Validation) Reset() { + *x = Specify_Parameter_Validation{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify_Parameter_Validation) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify_Parameter_Validation) ProtoMessage() {} + +func (x *Specify_Parameter_Validation) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify_Parameter_Validation.ProtoReflect.Descriptor instead. +func (*Specify_Parameter_Validation) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 2, 0} +} + +func (x *Specify_Parameter_Validation) GetType() Specify_Parameter_Validation_Type { + if x != nil { + return x.Type + } + return Specify_Parameter_Validation_TYPE_UNSPECIFIED +} + +func (x *Specify_Parameter_Validation) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +type Configure_Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Parameters map[string]string `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *Configure_Command) Reset() { + *x = Configure_Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Configure_Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Configure_Command) ProtoMessage() {} + +func (x *Configure_Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Configure_Command.ProtoReflect.Descriptor instead. +func (*Configure_Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{3, 0} +} + +func (x *Configure_Command) GetParameters() map[string]string { + if x != nil { + return x.Parameters + } + return nil +} + +type Configure_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` +} + +func (x *Configure_Response) Reset() { + *x = Configure_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Configure_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Configure_Response) ProtoMessage() {} + +func (x *Configure_Response) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Configure_Response.ProtoReflect.Descriptor instead. +func (*Configure_Response) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{3, 1} +} + +func (x *Configure_Response) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +type Open_Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Open_Command) Reset() { + *x = Open_Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Open_Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Open_Command) ProtoMessage() {} + +func (x *Open_Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Open_Command.ProtoReflect.Descriptor instead. +func (*Open_Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{4, 0} +} + +type Open_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` +} + +func (x *Open_Response) Reset() { + *x = Open_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Open_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Open_Response) ProtoMessage() {} + +func (x *Open_Response) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Open_Response.ProtoReflect.Descriptor instead. +func (*Open_Response) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{4, 1} +} + +func (x *Open_Response) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +type Process_Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Records []*v1.Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` +} + +func (x *Process_Command) Reset() { + *x = Process_Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process_Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process_Command) ProtoMessage() {} + +func (x *Process_Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process_Command.ProtoReflect.Descriptor instead. +func (*Process_Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *Process_Command) GetRecords() []*v1.Record { + if x != nil { + return x.Records + } + return nil +} + +type Process_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Records []*Process_ProcessedRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` +} + +func (x *Process_Response) Reset() { + *x = Process_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process_Response) ProtoMessage() {} + +func (x *Process_Response) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process_Response.ProtoReflect.Descriptor instead. +func (*Process_Response) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 1} +} + +func (x *Process_Response) GetRecords() []*Process_ProcessedRecord { + if x != nil { + return x.Records + } + return nil +} + +type Process_ProcessedRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Record: + // + // *Process_ProcessedRecord_SingleRecord + // *Process_ProcessedRecord_FilterRecord + // *Process_ProcessedRecord_ErrorRecord + Record isProcess_ProcessedRecord_Record `protobuf_oneof:"record"` +} + +func (x *Process_ProcessedRecord) Reset() { + *x = Process_ProcessedRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process_ProcessedRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process_ProcessedRecord) ProtoMessage() {} + +func (x *Process_ProcessedRecord) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process_ProcessedRecord.ProtoReflect.Descriptor instead. +func (*Process_ProcessedRecord) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 2} +} + +func (m *Process_ProcessedRecord) GetRecord() isProcess_ProcessedRecord_Record { + if m != nil { + return m.Record + } + return nil +} + +func (x *Process_ProcessedRecord) GetSingleRecord() *v1.Record { + if x, ok := x.GetRecord().(*Process_ProcessedRecord_SingleRecord); ok { + return x.SingleRecord + } + return nil +} + +func (x *Process_ProcessedRecord) GetFilterRecord() *Process_FilterRecord { + if x, ok := x.GetRecord().(*Process_ProcessedRecord_FilterRecord); ok { + return x.FilterRecord + } + return nil +} + +func (x *Process_ProcessedRecord) GetErrorRecord() *Process_ErrorRecord { + if x, ok := x.GetRecord().(*Process_ProcessedRecord_ErrorRecord); ok { + return x.ErrorRecord + } + return nil +} + +type isProcess_ProcessedRecord_Record interface { + isProcess_ProcessedRecord_Record() +} + +type Process_ProcessedRecord_SingleRecord struct { + SingleRecord *v1.Record `protobuf:"bytes,1,opt,name=single_record,json=singleRecord,proto3,oneof"` +} + +type Process_ProcessedRecord_FilterRecord struct { + FilterRecord *Process_FilterRecord `protobuf:"bytes,2,opt,name=filter_record,json=filterRecord,proto3,oneof"` +} + +type Process_ProcessedRecord_ErrorRecord struct { + ErrorRecord *Process_ErrorRecord `protobuf:"bytes,3,opt,name=error_record,json=errorRecord,proto3,oneof"` +} + +func (*Process_ProcessedRecord_SingleRecord) isProcess_ProcessedRecord_Record() {} + +func (*Process_ProcessedRecord_FilterRecord) isProcess_ProcessedRecord_Record() {} + +func (*Process_ProcessedRecord_ErrorRecord) isProcess_ProcessedRecord_Record() {} + +type Process_FilterRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Process_FilterRecord) Reset() { + *x = Process_FilterRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process_FilterRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process_FilterRecord) ProtoMessage() {} + +func (x *Process_FilterRecord) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process_FilterRecord.ProtoReflect.Descriptor instead. +func (*Process_FilterRecord) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 3} +} + +type Process_ErrorRecord struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` +} + +func (x *Process_ErrorRecord) Reset() { + *x = Process_ErrorRecord{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Process_ErrorRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Process_ErrorRecord) ProtoMessage() {} + +func (x *Process_ErrorRecord) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Process_ErrorRecord.ProtoReflect.Descriptor instead. +func (*Process_ErrorRecord) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 4} +} + +func (x *Process_ErrorRecord) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +type Teardown_Command struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Teardown_Command) Reset() { + *x = Teardown_Command{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Teardown_Command) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Teardown_Command) ProtoMessage() {} + +func (x *Teardown_Command) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Teardown_Command.ProtoReflect.Descriptor instead. +func (*Teardown_Command) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{6, 0} +} + +type Teardown_Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` +} + +func (x *Teardown_Response) Reset() { + *x = Teardown_Response{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Teardown_Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Teardown_Response) ProtoMessage() {} + +func (x *Teardown_Response) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Teardown_Response.ProtoReflect.Descriptor instead. +func (*Teardown_Response) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{6, 1} +} + +func (x *Teardown_Response) GetErr() string { + if x != nil { + return x.Err + } + return "" +} + +var File_processor_v1_processor_proto protoreflect.FileDescriptor + +var file_processor_v1_processor_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x6f, 0x70, + 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x5f, 0x63, 0x6d, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x79, 0x43, 0x6d, 0x64, 0x12, 0x46, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0c, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x6d, 0x64, 0x12, 0x37, 0x0a, 0x08, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, + 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x70, + 0x65, 0x6e, 0x43, 0x6d, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x43, 0x6d, 0x64, 0x12, 0x43, 0x0a, 0x0c, 0x74, 0x65, 0x61, 0x72, 0x64, + 0x6f, 0x77, 0x6e, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, + 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, + 0x0b, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x6d, 0x64, 0x42, 0x09, 0x0a, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0xf6, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x73, + 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x49, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, + 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x6f, + 0x70, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, + 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6f, + 0x70, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0d, + 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xb4, 0x07, 0x0a, 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x1a, 0x09, 0x0a, 0x07, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0xce, 0x02, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, + 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, + 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x1a, 0x5e, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, + 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xcc, 0x04, 0x0a, 0x09, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x0b, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfc, 0x01, 0x0a, 0x0a, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, + 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, + 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, + 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, + 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x53, + 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, + 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x06, 0x22, 0x7c, 0x0a, 0x04, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, + 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, + 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, + 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, + 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x55, 0x52, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x22, 0xc5, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x12, 0x4f, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, + 0x2f, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, + 0x22, 0xac, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, + 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, + 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x39, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, + 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x46, 0x0a, 0x0c, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, + 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x1f, + 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, + 0x33, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x65, 0x72, 0x72, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x69, + 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_processor_v1_processor_proto_rawDescOnce sync.Once + file_processor_v1_processor_proto_rawDescData = file_processor_v1_processor_proto_rawDesc +) + +func file_processor_v1_processor_proto_rawDescGZIP() []byte { + file_processor_v1_processor_proto_rawDescOnce.Do(func() { + file_processor_v1_processor_proto_rawDescData = protoimpl.X.CompressGZIP(file_processor_v1_processor_proto_rawDescData) + }) + return file_processor_v1_processor_proto_rawDescData +} + +var file_processor_v1_processor_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_processor_v1_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_processor_v1_processor_proto_goTypes = []interface{}{ + (Specify_Parameter_Type)(0), // 0: processor.v1.Specify.Parameter.Type + (Specify_Parameter_Validation_Type)(0), // 1: processor.v1.Specify.Parameter.Validation.Type + (*Command)(nil), // 2: processor.v1.Command + (*CommandResponse)(nil), // 3: processor.v1.CommandResponse + (*Specify)(nil), // 4: processor.v1.Specify + (*Configure)(nil), // 5: processor.v1.Configure + (*Open)(nil), // 6: processor.v1.Open + (*Process)(nil), // 7: processor.v1.Process + (*Teardown)(nil), // 8: processor.v1.Teardown + (*Specify_Command)(nil), // 9: processor.v1.Specify.Command + (*Specify_Response)(nil), // 10: processor.v1.Specify.Response + (*Specify_Parameter)(nil), // 11: processor.v1.Specify.Parameter + nil, // 12: processor.v1.Specify.Response.ParametersEntry + (*Specify_Parameter_Validation)(nil), // 13: processor.v1.Specify.Parameter.Validation + (*Configure_Command)(nil), // 14: processor.v1.Configure.Command + (*Configure_Response)(nil), // 15: processor.v1.Configure.Response + nil, // 16: processor.v1.Configure.Command.ParametersEntry + (*Open_Command)(nil), // 17: processor.v1.Open.Command + (*Open_Response)(nil), // 18: processor.v1.Open.Response + (*Process_Command)(nil), // 19: processor.v1.Process.Command + (*Process_Response)(nil), // 20: processor.v1.Process.Response + (*Process_ProcessedRecord)(nil), // 21: processor.v1.Process.ProcessedRecord + (*Process_FilterRecord)(nil), // 22: processor.v1.Process.FilterRecord + (*Process_ErrorRecord)(nil), // 23: processor.v1.Process.ErrorRecord + (*Teardown_Command)(nil), // 24: processor.v1.Teardown.Command + (*Teardown_Response)(nil), // 25: processor.v1.Teardown.Response + (*v1.Record)(nil), // 26: opencdc.v1.Record +} +var file_processor_v1_processor_proto_depIdxs = []int32{ + 9, // 0: processor.v1.Command.specify_cmd:type_name -> processor.v1.Specify.Command + 14, // 1: processor.v1.Command.configure_cmd:type_name -> processor.v1.Configure.Command + 17, // 2: processor.v1.Command.open_cmd:type_name -> processor.v1.Open.Command + 19, // 3: processor.v1.Command.process_cmd:type_name -> processor.v1.Process.Command + 24, // 4: processor.v1.Command.teardown_cmd:type_name -> processor.v1.Teardown.Command + 10, // 5: processor.v1.CommandResponse.specify_resp:type_name -> processor.v1.Specify.Response + 15, // 6: processor.v1.CommandResponse.configure_resp:type_name -> processor.v1.Configure.Response + 18, // 7: processor.v1.CommandResponse.open_resp:type_name -> processor.v1.Open.Response + 20, // 8: processor.v1.CommandResponse.process_resp:type_name -> processor.v1.Process.Response + 25, // 9: processor.v1.CommandResponse.teardown_resp:type_name -> processor.v1.Teardown.Response + 12, // 10: processor.v1.Specify.Response.parameters:type_name -> processor.v1.Specify.Response.ParametersEntry + 0, // 11: processor.v1.Specify.Parameter.type:type_name -> processor.v1.Specify.Parameter.Type + 13, // 12: processor.v1.Specify.Parameter.validations:type_name -> processor.v1.Specify.Parameter.Validation + 11, // 13: processor.v1.Specify.Response.ParametersEntry.value:type_name -> processor.v1.Specify.Parameter + 1, // 14: processor.v1.Specify.Parameter.Validation.type:type_name -> processor.v1.Specify.Parameter.Validation.Type + 16, // 15: processor.v1.Configure.Command.parameters:type_name -> processor.v1.Configure.Command.ParametersEntry + 26, // 16: processor.v1.Process.Command.records:type_name -> opencdc.v1.Record + 21, // 17: processor.v1.Process.Response.records:type_name -> processor.v1.Process.ProcessedRecord + 26, // 18: processor.v1.Process.ProcessedRecord.single_record:type_name -> opencdc.v1.Record + 22, // 19: processor.v1.Process.ProcessedRecord.filter_record:type_name -> processor.v1.Process.FilterRecord + 23, // 20: processor.v1.Process.ProcessedRecord.error_record:type_name -> processor.v1.Process.ErrorRecord + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name +} + +func init() { file_processor_v1_processor_proto_init() } +func file_processor_v1_processor_proto_init() { + if File_processor_v1_processor_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_processor_v1_processor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CommandResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configure); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Open); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Teardown); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify_Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify_Parameter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify_Parameter_Validation); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configure_Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configure_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Open_Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Open_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process_Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process_ProcessedRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process_FilterRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Process_ErrorRecord); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Teardown_Command); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Teardown_Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_processor_v1_processor_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*Command_SpecifyCmd)(nil), + (*Command_ConfigureCmd)(nil), + (*Command_OpenCmd)(nil), + (*Command_ProcessCmd)(nil), + (*Command_TeardownCmd)(nil), + } + file_processor_v1_processor_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*CommandResponse_SpecifyResp)(nil), + (*CommandResponse_ConfigureResp)(nil), + (*CommandResponse_OpenResp)(nil), + (*CommandResponse_ProcessResp)(nil), + (*CommandResponse_TeardownResp)(nil), + } + file_processor_v1_processor_proto_msgTypes[19].OneofWrappers = []interface{}{ + (*Process_ProcessedRecord_SingleRecord)(nil), + (*Process_ProcessedRecord_FilterRecord)(nil), + (*Process_ProcessedRecord_ErrorRecord)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_processor_v1_processor_proto_rawDesc, + NumEnums: 2, + NumMessages: 24, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_processor_v1_processor_proto_goTypes, + DependencyIndexes: file_processor_v1_processor_proto_depIdxs, + EnumInfos: file_processor_v1_processor_proto_enumTypes, + MessageInfos: file_processor_v1_processor_proto_msgTypes, + }.Build() + File_processor_v1_processor_proto = out.File + file_processor_v1_processor_proto_rawDesc = nil + file_processor_v1_processor_proto_goTypes = nil + file_processor_v1_processor_proto_depIdxs = nil +} diff --git a/internal/proto/processor/v1/processor.proto b/internal/proto/processor/v1/processor.proto new file mode 100644 index 0000000..bc5eb09 --- /dev/null +++ b/internal/proto/processor/v1/processor.proto @@ -0,0 +1,146 @@ +syntax = "proto3"; + +package processor.v1; + +import "opencdc/v1/opencdc.proto"; + +message Command { + oneof command { + Specify.Command specify_cmd = 1; + Configure.Command configure_cmd = 2; + Open.Command open_cmd = 3; + Process.Command process_cmd = 4; + Teardown.Command teardown_cmd = 5; + } +} +message CommandResponse { + oneof response { + Specify.Response specify_resp = 1; + Configure.Response configure_resp = 2; + Open.Response open_resp = 3; + Process.Response process_resp = 4; + Teardown.Response teardown_resp = 5; + } +} + +message Specify { + message Command {} + message Response { + // Name is the name of the plugin. + string name = 1; + // Summary is a brief description of the plugin and what it does, + // ideally not longer than one sentence. + string summary = 2; + // Description is a longer form field, appropriate for README-like + // text that the author can provide for documentation about the + // usage of the plugin. + string description = 3; + // Version string. Should follow semantic versioning and use the "v" + // prefix (e.g. v1.23.4). + string version = 4; + // Author declares the entity that created or maintains this plugin. + string author = 5; + // A map that describes parameters available for configuring the + // destination plugin. + map parameters = 6; + string err = 7; + } + + // Parameter describes a single config parameter. + message Parameter { + // Validation to be made on the parameter. + message Validation { + enum Type { + TYPE_UNSPECIFIED = 0; + // Parameter must be present. + TYPE_REQUIRED = 1; + // Parameter must be greater than {value}. + TYPE_GREATER_THAN = 2; + // Parameter must be less than {value}. + TYPE_LESS_THAN = 3; + // Parameter must be included in the comma separated list {value}. + TYPE_INCLUSION = 4; + // Parameter must not be included in the comma separated list {value}. + TYPE_EXCLUSION = 5; + // Parameter must match the regex {value}. + TYPE_REGEX = 6; + } + + Type type = 1; + // The value to be compared with the parameter, + // or a comma separated list in case of Validation.TYPE_INCLUSION or Validation.TYPE_EXCLUSION. + string value = 2; + } + + // Type shows the parameter type. + enum Type { + TYPE_UNSPECIFIED = 0; + // Parameter is a string. + TYPE_STRING = 1; + // Parameter is an integer. + TYPE_INT = 2; + // Parameter is a float. + TYPE_FLOAT = 3; + // Parameter is a boolean. + TYPE_BOOL = 4; + // Parameter is a file. + TYPE_FILE = 5; + // Parameter is a duration. + TYPE_DURATION = 6; + } + + // Default is the default value of the parameter. If there is no default + // value use an empty string. + string default = 1; + // Description explains what the parameter does and how to configure it. + string description = 2; + // Type defines the parameter data type. + Type type = 3; + // Validations are validations to be made on the parameter. + repeated Validation validations = 4; + } +} + +message Configure { + message Command { + map parameters = 1; + } + + message Response { + string err = 1; + } +} + +message Open { + message Command {} + message Response { + string err = 1; + } +} + +message Process { + message Command { + repeated opencdc.v1.Record records = 1; + } + message Response { + repeated ProcessedRecord records = 1; + } + message ProcessedRecord { + oneof record { + opencdc.v1.Record single_record = 1; + FilterRecord filter_record = 2; + ErrorRecord error_record = 3; + } + } + message FilterRecord {} + message ErrorRecord { + string err = 1; + } +} + +message Teardown { + message Command {} + message Response { + string err = 1; + } +} \ No newline at end of file diff --git a/internal/proto/to_proto.go b/internal/proto/to_proto.go new file mode 100644 index 0000000..4497ecd --- /dev/null +++ b/internal/proto/to_proto.go @@ -0,0 +1,254 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package proto + +import ( + "fmt" + + "github.com/conduitio/conduit-commons/opencdc" + opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" + sdk "github.com/conduitio/conduit-processor-sdk" + procproto "github.com/conduitio/conduit-processor-sdk/internal/proto/processor/v1" + "google.golang.org/protobuf/proto" +) + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + var validationTypes [1]struct{} + _ = validationTypes[int(sdk.ValidationTypeRequired)-int(procproto.Specify_Parameter_Validation_TYPE_REQUIRED)] + _ = validationTypes[int(sdk.ValidationTypeRegex)-int(procproto.Specify_Parameter_Validation_TYPE_REGEX)] + _ = validationTypes[int(sdk.ValidationTypeInclusion)-int(procproto.Specify_Parameter_Validation_TYPE_INCLUSION)] + _ = validationTypes[int(sdk.ValidationTypeExclusion)-int(procproto.Specify_Parameter_Validation_TYPE_EXCLUSION)] + _ = validationTypes[int(sdk.ValidationTypeLessThan)-int(procproto.Specify_Parameter_Validation_TYPE_LESS_THAN)] + _ = validationTypes[int(sdk.ValidationTypeGreaterThan)-int(procproto.Specify_Parameter_Validation_TYPE_GREATER_THAN)] + + var paramTypes [1]struct{} + _ = paramTypes[int(sdk.ParameterTypeInt)-int(procproto.Specify_Parameter_TYPE_INT)] + _ = paramTypes[int(sdk.ParameterTypeFloat)-int(procproto.Specify_Parameter_TYPE_FLOAT)] + _ = paramTypes[int(sdk.ParameterTypeBool)-int(procproto.Specify_Parameter_TYPE_BOOL)] + _ = paramTypes[int(sdk.ParameterTypeString)-int(procproto.Specify_Parameter_TYPE_STRING)] + _ = paramTypes[int(sdk.ParameterTypeDuration)-int(procproto.Specify_Parameter_TYPE_DURATION)] + _ = paramTypes[int(sdk.ParameterTypeFile)-int(procproto.Specify_Parameter_TYPE_FILE)] +} + +func MarshalCommand(cmd sdk.Command) ([]byte, error) { + protoCmd, err := protoCommand(cmd) + if err != nil { + return nil, fmt.Errorf("failed converting sdk.Command to protobuf command: %w", err) + } + + bytes, err := proto.Marshal(protoCmd) + if err != nil { + return nil, fmt.Errorf("failed marshalling protobuf command: %w", err) + } + + return bytes, nil +} + +func protoCommand(cmd sdk.Command) (*procproto.Command, error) { + if cmd == nil { + return nil, ErrNilCommand + } + + switch v := cmd.(type) { + case *sdk.SpecifyCmd: + return &procproto.Command{ + Command: &procproto.Command_SpecifyCmd{ + SpecifyCmd: &procproto.Specify_Command{}, + }, + }, nil + case *sdk.ConfigureCmd: + return &procproto.Command{ + Command: &procproto.Command_ConfigureCmd{ + ConfigureCmd: &procproto.Configure_Command{ + Parameters: v.ConfigMap, + }, + }, + }, nil + case *sdk.OpenCmd: + return &procproto.Command{ + Command: &procproto.Command_OpenCmd{ + OpenCmd: &procproto.Open_Command{}, + }, + }, nil + case *sdk.ProcessCmd: + recs, err := protoRecords(v.Records) + if err != nil { + return nil, err + } + return &procproto.Command{ + Command: &procproto.Command_ProcessCmd{ + ProcessCmd: &procproto.Process_Command{ + Records: recs, + }, + }, + }, nil + case *sdk.TeardownCmd: + return &procproto.Command{ + Command: &procproto.Command_TeardownCmd{ + TeardownCmd: &procproto.Teardown_Command{}, + }, + }, nil + default: + return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) + } +} + +func MarshalCommandResponse(resp sdk.CommandResponse) ([]byte, error) { + if resp == nil { + return nil, ErrNilCommand + } + + protoResp := &procproto.CommandResponse{} + switch v := resp.(type) { + case *sdk.SpecifyResponse: + protoResp.Response = &procproto.CommandResponse_SpecifyResp{ + SpecifyResp: &procproto.Specify_Response{ + Name: v.Specification.Name, + Summary: v.Specification.Summary, + Description: v.Specification.Description, + Version: v.Specification.Version, + Author: v.Specification.Author, + Parameters: protoSpecificationParams(v.Specification.Parameters), + Err: errorToString(v.Err), + }, + } + case *sdk.ConfigureResponse: + protoResp.Response = &procproto.CommandResponse_ConfigureResp{ + ConfigureResp: &procproto.Configure_Response{ + Err: errorToString(v.Err), + }, + } + case *sdk.OpenResponse: + protoResp.Response = &procproto.CommandResponse_OpenResp{ + OpenResp: &procproto.Open_Response{ + Err: errorToString(v.Err), + }, + } + case *sdk.ProcessResponse: + recs, err := protoProcessedRecords(v.Records) + if err != nil { + return nil, err + } + protoResp.Response = &procproto.CommandResponse_ProcessResp{ + ProcessResp: &procproto.Process_Response{ + Records: recs, + }, + } + case *sdk.TeardownResponse: + protoResp.Response = &procproto.CommandResponse_TeardownResp{ + TeardownResp: &procproto.Teardown_Response{ + Err: errorToString(v.Err), + }, + } + default: + return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) + } + + bytes, err := proto.Marshal(protoResp) + if err != nil { + return nil, fmt.Errorf("failed unmarshaling bytes into protobuf message: %w", err) + } + + return bytes, nil +} + +func errorToString(err error) string { + if err == nil { + return "" + } + + return err.Error() +} + +func protoSpecificationParams(in map[string]sdk.Parameter) map[string]*procproto.Specify_Parameter { + out := make(map[string]*procproto.Specify_Parameter, len(in)) + for name, param := range in { + out[name] = &procproto.Specify_Parameter{ + Default: param.Default, + Description: param.Description, + Type: procproto.Specify_Parameter_Type(param.Type), + Validations: protoSpecValidations(param.Validations), + } + } + + return out +} + +func protoSpecValidations(in []sdk.Validation) []*procproto.Specify_Parameter_Validation { + if in == nil { + return nil + } + + out := make([]*procproto.Specify_Parameter_Validation, len(in)) + for i, v := range in { + out[i] = &procproto.Specify_Parameter_Validation{ + Type: procproto.Specify_Parameter_Validation_Type(v.Type), + Value: v.Value, + } + } + + return out +} + +func protoProcessedRecords(in []sdk.ProcessedRecord) ([]*procproto.Process_ProcessedRecord, error) { + if in == nil { + return nil, nil + } + + out := make([]*procproto.Process_ProcessedRecord, len(in)) + for i, rec := range in { + outRec := &procproto.Process_ProcessedRecord{} + // todo handle nil + switch v := rec.(type) { + case sdk.SingleRecord: + protoRec := &opencdcv1.Record{} + err := opencdc.Record(v).ToProto(protoRec) + if err != nil { + return nil, fmt.Errorf("failed converting record %v to proto: %w", i, err) + } + outRec.Record = &procproto.Process_ProcessedRecord_SingleRecord{ + SingleRecord: protoRec, + } + case sdk.FilterRecord: + outRec.Record = &procproto.Process_ProcessedRecord_FilterRecord{} + case sdk.ErrorRecord: + outRec.Record = &procproto.Process_ProcessedRecord_ErrorRecord{ + ErrorRecord: &procproto.Process_ErrorRecord{ + // todo check if v.Err is nil by mistake + Err: v.Err.Error(), + }, + } + } + + out[i] = outRec + } + + return out, nil +} + +func protoRecords(records []opencdc.Record) ([]*opencdcv1.Record, error) { + out := make([]*opencdcv1.Record, len(records)) + for i, record := range records { + outRec := &opencdcv1.Record{} + err := record.ToProto(outRec) + if err != nil { + return nil, fmt.Errorf("failed converting record %v to proto: %w", i, err) + } + out[i] = outRec + } + + return out, nil +} diff --git a/internal/wasm_commands.go b/internal/wasm/command_actions.go similarity index 59% rename from internal/wasm_commands.go rename to internal/wasm/command_actions.go index 1725bb2..3d174e5 100644 --- a/internal/wasm_commands.go +++ b/internal/wasm/command_actions.go @@ -12,37 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package wasm import ( - "errors" "fmt" - "math" - "github.com/goccy/go-json" + sdk "github.com/conduitio/conduit-processor-sdk" + "github.com/conduitio/conduit-processor-sdk/internal/proto" ) -var ( - defaultCommandSize = uint32(1024) - - // ErrorCodeStart is the smallest error code which the host (i.e. Conduit) can send. - // The imported function _nextCommand returns an uint32 value - // that is either the number of bytes actually written or an error code. - // Because of that, we're reserving a range of error codes. - ErrorCodeStart = math.MaxUint32 - uint32(100) -) - -var ( - ErrCannotUnmarshalCommand = errors.New("cannot unmarshal command") - ErrNextCommand = errors.New("failed getting next command") -) - -type Command struct { - Name string `json:"name"` -} +var defaultCommandSize = uint32(1024) // NextCommand retrieves the next command from Conduit. -func NextCommand() (Command, error) { +func NextCommand() (sdk.Command, error) { // allocate some memory for Conduit to write the command // we're allocating some memory in advance, so that // we don't need to introduce another call just to @@ -53,25 +35,31 @@ func NextCommand() (Command, error) { // request Conduit to write the command to the given allocation fmt.Println("getting next command") resp := _nextCommand(ptr, defaultCommandSize) - if resp > ErrorCodeStart { // error codes + if resp > sdk.ErrorCodeStart { // error codes // todo if more memory is needed, allocate it // https://github.com/ConduitIO/conduit-processor-sdk/issues/6 fmt.Printf("got error code: %v\n", resp) - return Command{}, fmt.Errorf("error code %v: %w", resp, ErrNextCommand) + return nil, fmt.Errorf("error code %v: %w", resp, sdk.ErrNextCommand) } // parse the command - var cmd Command - err := json.Unmarshal(ptrToByteArray(ptr, resp), &cmd) + cmd, err := proto.UnmarshalCommand(ptrToByteArray(ptr, resp)) if err != nil { - return Command{}, ErrCannotUnmarshalCommand + return nil, fmt.Errorf("failed unmarshalling command: %w", err) } return cmd, nil } -func Reply(bytes []byte) { +func Reply(resp sdk.CommandResponse) error { + bytes, err := proto.MarshalCommandResponse(resp) + if err != nil { + return fmt.Errorf("failed marshalling CommandResponse to bytes: %w", err) + } + ptr, cleanup := Write(bytes) defer cleanup() _reply(ptr, uint32(len(bytes))) + + return nil } diff --git a/internal/wasm_imports.go b/internal/wasm/imports.go similarity index 98% rename from internal/wasm_imports.go rename to internal/wasm/imports.go index bf557ae..b339fcb 100644 --- a/internal/wasm_imports.go +++ b/internal/wasm/imports.go @@ -14,7 +14,7 @@ //go:build wasm -package internal +package wasm // Imports `nextCommand` from the host, which retrieves // the next command for a processor. diff --git a/internal/wasm_imports_stub.go b/internal/wasm/imports_stub.go similarity index 95% rename from internal/wasm_imports_stub.go rename to internal/wasm/imports_stub.go index 8fa1cd4..7152a84 100644 --- a/internal/wasm_imports_stub.go +++ b/internal/wasm/imports_stub.go @@ -13,13 +13,13 @@ // limitations under the License. // The functions in this file are stubs of the functions defined -// in wasm_imports.go. +// in imports.go. // They exist to make it possible to test, lint // or generally run the code in a non-WASM environment. //go:build !wasm -package internal +package wasm func _nextCommand(_, _ uint32) uint32 { panic("stub") diff --git a/internal/wasm_memory.go b/internal/wasm/memory.go similarity index 92% rename from internal/wasm_memory.go rename to internal/wasm/memory.go index cc5e9de..6722636 100644 --- a/internal/wasm_memory.go +++ b/internal/wasm/memory.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package internal +package wasm import ( "fmt" @@ -22,7 +22,7 @@ import ( var allocations = make(map[uintptr][]byte) func allocate(size uint32) (uint32, func()) { - fmt.Printf("allocating %v bytes", size) + fmt.Printf("allocating %v bytes\n", size) return Write(make([]byte, size)) } @@ -32,6 +32,7 @@ func free(ptr unsafe.Pointer) { return } + fmt.Printf("freeing up memory at %v\n", ptr) if _, ok := allocations[uintptr(ptr)]; ok { delete(allocations, uintptr(ptr)) } else { diff --git a/mock/processor.go b/mock/processor.go index 616973a..dad7d33 100644 --- a/mock/processor.go +++ b/mock/processor.go @@ -84,11 +84,12 @@ func (mr *ProcessorMockRecorder) Process(arg0, arg1 any) *gomock.Call { } // Specification mocks base method. -func (m *Processor) Specification() sdk.Specification { +func (m *Processor) Specification() (sdk.Specification, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Specification") ret0, _ := ret[0].(sdk.Specification) - return ret0 + ret1, _ := ret[1].(error) + return ret0, ret1 } // Specification indicates an expected call of Specification. diff --git a/processor.go b/processor.go index b75f26f..54a4987 100644 --- a/processor.go +++ b/processor.go @@ -27,7 +27,7 @@ import ( type Processor interface { // Specification contains the metadata of this processor like name, version, // description and a list of parameters expected in the configuration. - Specification() Specification + Specification() (Specification, error) // Configure is the first function to be called in a processor. It provides the // processor with the configuration that needs to be validated and stored. diff --git a/run.go b/run/run.go similarity index 62% rename from run.go rename to run/run.go index 1a947c5..6f79832 100644 --- a/run.go +++ b/run/run.go @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -package sdk +package run import ( + "context" "fmt" + "os" - "github.com/conduitio/conduit-processor-sdk/internal" - "github.com/goccy/go-json" + sdk "github.com/conduitio/conduit-processor-sdk" + "github.com/conduitio/conduit-processor-sdk/internal/wasm" ) // Run is the 'entry point' for a processor. It runs a @@ -26,25 +28,19 @@ import ( // communicates with Conduit. // // A processor plugin needs to call this function in its main() function. -func Run(p Processor) { +func Run(p sdk.Processor) { for { - cmd, err := internal.NextCommand() + cmd, err := wasm.NextCommand() if err != nil { - fmt.Printf("failed retrieving next command: %v", cmd) - return + _, _ = fmt.Fprintf(os.Stderr, "failed retrieving next command: %v", err) + os.Exit(1) } - if cmd.Name == "specify" { - fmt.Println("getting specification") - spec := p.Specification() - - bytes, err := json.Marshal(spec) - if err != nil { - fmt.Printf("failed serializing specification: %v", err) - } - internal.Reply(bytes) - } else { - fmt.Printf("got unknown command: %v\n", cmd.Name) + resp := cmd.Execute(context.Background(), p) + err = wasm.Reply(resp) + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "failed writing reply: %v\n", err) + os.Exit(1) } } } diff --git a/serde/serde.go b/serde/serde.go new file mode 100644 index 0000000..d7b78b4 --- /dev/null +++ b/serde/serde.go @@ -0,0 +1,30 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package serde + +import ( + sdk "github.com/conduitio/conduit-processor-sdk" + "github.com/conduitio/conduit-processor-sdk/internal/proto" +) + +func MarshalCommand(resp sdk.Command) ([]byte, error) { + //nolint:wrapcheck // a wrapper function to be used in Conduit + return proto.MarshalCommand(resp) +} + +func UnmarshalCommandResponse(bytes []byte) (sdk.CommandResponse, error) { + //nolint:wrapcheck // a wrapper function to be used in Conduit + return proto.UnmarshalCommandResponse(bytes) +} diff --git a/tools.go b/tools.go index 67e5f81..6ffef52 100644 --- a/tools.go +++ b/tools.go @@ -17,6 +17,7 @@ package main import ( + _ "github.com/bufbuild/buf/cmd/buf" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "go.uber.org/mock/mockgen" _ "mvdan.cc/gofumpt" From 3c390eb9a81a2b71a13930a03cab0c05be7b8f53 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Wed, 27 Dec 2023 13:31:15 +0100 Subject: [PATCH 02/17] return Error() method --- command.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/command.go b/command.go index d1a8389..6f8660d 100644 --- a/command.go +++ b/command.go @@ -25,6 +25,7 @@ type Command interface { } type CommandResponse interface { + Error() error isCommandResponse() } @@ -40,6 +41,10 @@ type SpecifyResponse struct { Err error } +func (r *SpecifyResponse) Error() error { + return r.Err +} + func (r *SpecifyResponse) isCommandResponse() {} type ConfigureCmd struct { @@ -56,6 +61,10 @@ type ConfigureResponse struct { Err error } +func (r *ConfigureResponse) Error() error { + return r.Err +} + func (r *ConfigureResponse) isCommandResponse() {} type OpenCmd struct{} @@ -68,6 +77,10 @@ type OpenResponse struct { Err error } +func (r *OpenResponse) Error() error { + return r.Err +} + func (r *OpenResponse) isCommandResponse() {} type ProcessCmd struct { @@ -82,6 +95,10 @@ type ProcessResponse struct { Records []ProcessedRecord } +func (r *ProcessResponse) Error() error { + return nil +} + func (r *ProcessResponse) isCommandResponse() {} type TeardownCmd struct{} @@ -96,4 +113,8 @@ type TeardownResponse struct { Err error } +func (r *TeardownResponse) Error() error { + return r.Err +} + func (r *TeardownResponse) isCommandResponse() {} From cf01fb4080e0255cbc49557d0e29059c27b5285a Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 28 Dec 2023 15:47:35 +0100 Subject: [PATCH 03/17] add sdk.ErrNoMoreCommands --- errors.go | 5 ++++- run/run.go | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/errors.go b/errors.go index 9382330..762c891 100644 --- a/errors.go +++ b/errors.go @@ -31,4 +31,7 @@ var ( ErrMemoryOutOfRange = math.MaxUint32 - uint32(3) ) -var ErrNextCommand = errors.New("failed getting next command") +var ( + ErrNextCommand = errors.New("failed getting next command") + ErrNoMoreCommands = errors.New("no more commands") +) diff --git a/run/run.go b/run/run.go index 6f79832..07bef37 100644 --- a/run/run.go +++ b/run/run.go @@ -16,6 +16,7 @@ package run import ( "context" + "errors" "fmt" "os" @@ -33,7 +34,11 @@ func Run(p sdk.Processor) { cmd, err := wasm.NextCommand() if err != nil { _, _ = fmt.Fprintf(os.Stderr, "failed retrieving next command: %v", err) - os.Exit(1) + exitCode := 1 + if errors.Is(err, sdk.ErrNoMoreCommands) { + exitCode = 0 + } + os.Exit(exitCode) } resp := cmd.Execute(context.Background(), p) From d81d2e419cd369f7e63be7bba9f786b1e3f7be2b Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 28 Dec 2023 15:52:42 +0100 Subject: [PATCH 04/17] add sdk.ErrNoMoreCommands --- errors.go | 1 + internal/wasm/command_actions.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/errors.go b/errors.go index 762c891..c50b3a1 100644 --- a/errors.go +++ b/errors.go @@ -29,6 +29,7 @@ var ( ErrCodeInsufficientSize = math.MaxUint32 - uint32(1) ErrCodeFailedGettingCommand = math.MaxUint32 - uint32(2) ErrMemoryOutOfRange = math.MaxUint32 - uint32(3) + ErrCodeNoMoreCommands = math.MaxUint32 - uint32(4) ) var ( diff --git a/internal/wasm/command_actions.go b/internal/wasm/command_actions.go index 3d174e5..bcf4327 100644 --- a/internal/wasm/command_actions.go +++ b/internal/wasm/command_actions.go @@ -39,6 +39,10 @@ func NextCommand() (sdk.Command, error) { // todo if more memory is needed, allocate it // https://github.com/ConduitIO/conduit-processor-sdk/issues/6 fmt.Printf("got error code: %v\n", resp) + + if resp == sdk.ErrCodeNoMoreCommands { + return nil, fmt.Errorf("error code %v: %w", resp, sdk.ErrNoMoreCommands) + } return nil, fmt.Errorf("error code %v: %w", resp, sdk.ErrNextCommand) } From d236e2dac799d3af4cb567a41d97e235e03b38f6 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 28 Dec 2023 20:58:15 +0100 Subject: [PATCH 05/17] rename, fix --- errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errors.go b/errors.go index c50b3a1..3fe3e0c 100644 --- a/errors.go +++ b/errors.go @@ -24,11 +24,11 @@ var ( // The imported function _nextCommand returns an uint32 value // that is either the number of bytes actually written or an error code. // Because of that, we're reserving a range of error codes. - ErrorCodeStart = ErrMemoryOutOfRange + ErrorCodeStart = ErrCodeNoMoreCommands ErrCodeInsufficientSize = math.MaxUint32 - uint32(1) ErrCodeFailedGettingCommand = math.MaxUint32 - uint32(2) - ErrMemoryOutOfRange = math.MaxUint32 - uint32(3) + ErrCodeMemoryOutOfRange = math.MaxUint32 - uint32(3) ErrCodeNoMoreCommands = math.MaxUint32 - uint32(4) ) From 2710881837a3fc058c0d93e4a3e41cc17f497c4f Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 4 Jan 2024 13:08:57 +0100 Subject: [PATCH 06/17] update conduit-commons --- internal/proto/buf.gen.yaml | 2 +- internal/proto/buf.lock | 6 +++--- internal/proto/buf.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/proto/buf.gen.yaml b/internal/proto/buf.gen.yaml index c8daba0..6ded409 100644 --- a/internal/proto/buf.gen.yaml +++ b/internal/proto/buf.gen.yaml @@ -4,7 +4,7 @@ managed: go_package_prefix: default: "github.com/conduitio/conduit-processor-sdk/internal/proto" except: - - buf.build/haris/conduit-commons + - buf.build/conduitio/conduit-commons plugins: - plugin: buf.build/protocolbuffers/go:v1.31.0 out: . diff --git a/internal/proto/buf.lock b/internal/proto/buf.lock index 326e7c6..4d56ced 100644 --- a/internal/proto/buf.lock +++ b/internal/proto/buf.lock @@ -2,7 +2,7 @@ version: v1 deps: - remote: buf.build - owner: haris + owner: conduitio repository: conduit-commons - commit: f9ca4999fb9445959d78b9f627bf8d19 - digest: shake256:93c24c6a3816c3812533c16ad455b3e948ee7581692652fbc88d1b5c87e15453733d93b5c644576b081bb0db96f01a43365bf6811c5736aaccfeea74c1911a0a + commit: de2e1a18c9e042119dedd69b852efc21 + digest: shake256:1275ac9a7d437cc6b48bd6ff2e9edc59f0450a8f9ab6050f49fb9949e231b7f4d91debfd42b09fc29d9e4aed1b9904266a46a46f7a5676218b53aafb7efe211d diff --git a/internal/proto/buf.yaml b/internal/proto/buf.yaml index cd91f86..4755783 100644 --- a/internal/proto/buf.yaml +++ b/internal/proto/buf.yaml @@ -1,7 +1,7 @@ version: v1 name: buf.build/conduitio/conduit-processor-sdk deps: - - buf.build/haris/conduit-commons:v0.1.3 + - buf.build/conduitio/conduit-commons lint: service_suffix: Plugin use: From 76b86524cf97c199409316c4030bf4cc57c02212 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 4 Jan 2024 13:44:04 +0100 Subject: [PATCH 07/17] update conduit commons --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e5dc224..59c4b47 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.21.5 require ( github.com/bufbuild/buf v1.28.1 - github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45 + github.com/conduitio/conduit-commons v0.0.0-20240103200651-5a5746611a8e github.com/golangci/golangci-lint v1.55.2 github.com/matryer/is v1.4.1 go.uber.org/mock v0.4.0 diff --git a/go.sum b/go.sum index ab58f75..15223e8 100644 --- a/go.sum +++ b/go.sum @@ -141,8 +141,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45 h1:GJhyDjoyswfJdqKyszQvevOw/xAz6ilNgN8q6T0lDeQ= -github.com/conduitio/conduit-commons v0.0.0-20231222154604-f6dfae573b45/go.mod h1:+bKjNjWYkbc/MMkBFSzND09FxpPD3GqjmPRQMndkvZ0= +github.com/conduitio/conduit-commons v0.0.0-20240103200651-5a5746611a8e h1:v0bwYB9rByFyg0CId+mJrw5qxPUsVWpgcP/QHVP7fyg= +github.com/conduitio/conduit-commons v0.0.0-20240103200651-5a5746611a8e/go.mod h1:lnHoVI2Vqhwjfacvr6J3A7UpkZrOtay6TJwaMhL47fc= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= From 21001e7c63d9637869dc997bac20686e410b5ae2 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 4 Jan 2024 19:30:00 +0100 Subject: [PATCH 08/17] export proto --- internal/wasm/command_actions.go | 2 +- {internal/proto => proto}/buf.gen.yaml | 0 {internal/proto => proto}/buf.lock | 0 {internal/proto => proto}/buf.yaml | 0 .../proto => proto}/command_protobuf_test.go | 0 {internal/proto => proto}/errors.go | 0 {internal/proto => proto}/from_proto.go | 2 +- .../processor/v1/processor.pb.go | 0 .../processor/v1/processor.proto | 0 {internal/proto => proto}/to_proto.go | 110 +++++++++--------- serde/serde.go | 6 +- 11 files changed, 60 insertions(+), 60 deletions(-) rename {internal/proto => proto}/buf.gen.yaml (100%) rename {internal/proto => proto}/buf.lock (100%) rename {internal/proto => proto}/buf.yaml (100%) rename {internal/proto => proto}/command_protobuf_test.go (100%) rename {internal/proto => proto}/errors.go (100%) rename {internal/proto => proto}/from_proto.go (98%) rename {internal/proto => proto}/processor/v1/processor.pb.go (100%) rename {internal/proto => proto}/processor/v1/processor.proto (100%) rename {internal/proto => proto}/to_proto.go (55%) diff --git a/internal/wasm/command_actions.go b/internal/wasm/command_actions.go index bcf4327..d14d9de 100644 --- a/internal/wasm/command_actions.go +++ b/internal/wasm/command_actions.go @@ -18,7 +18,7 @@ import ( "fmt" sdk "github.com/conduitio/conduit-processor-sdk" - "github.com/conduitio/conduit-processor-sdk/internal/proto" + "github.com/conduitio/conduit-processor-sdk/proto" ) var defaultCommandSize = uint32(1024) diff --git a/internal/proto/buf.gen.yaml b/proto/buf.gen.yaml similarity index 100% rename from internal/proto/buf.gen.yaml rename to proto/buf.gen.yaml diff --git a/internal/proto/buf.lock b/proto/buf.lock similarity index 100% rename from internal/proto/buf.lock rename to proto/buf.lock diff --git a/internal/proto/buf.yaml b/proto/buf.yaml similarity index 100% rename from internal/proto/buf.yaml rename to proto/buf.yaml diff --git a/internal/proto/command_protobuf_test.go b/proto/command_protobuf_test.go similarity index 100% rename from internal/proto/command_protobuf_test.go rename to proto/command_protobuf_test.go diff --git a/internal/proto/errors.go b/proto/errors.go similarity index 100% rename from internal/proto/errors.go rename to proto/errors.go diff --git a/internal/proto/from_proto.go b/proto/from_proto.go similarity index 98% rename from internal/proto/from_proto.go rename to proto/from_proto.go index 9d181e7..8a5e2bd 100644 --- a/internal/proto/from_proto.go +++ b/proto/from_proto.go @@ -21,7 +21,7 @@ import ( "github.com/conduitio/conduit-commons/opencdc" opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" sdk "github.com/conduitio/conduit-processor-sdk" - processorv1 "github.com/conduitio/conduit-processor-sdk/internal/proto/processor/v1" + processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" "google.golang.org/protobuf/proto" ) diff --git a/internal/proto/processor/v1/processor.pb.go b/proto/processor/v1/processor.pb.go similarity index 100% rename from internal/proto/processor/v1/processor.pb.go rename to proto/processor/v1/processor.pb.go diff --git a/internal/proto/processor/v1/processor.proto b/proto/processor/v1/processor.proto similarity index 100% rename from internal/proto/processor/v1/processor.proto rename to proto/processor/v1/processor.proto diff --git a/internal/proto/to_proto.go b/proto/to_proto.go similarity index 55% rename from internal/proto/to_proto.go rename to proto/to_proto.go index 4497ecd..092e9c7 100644 --- a/internal/proto/to_proto.go +++ b/proto/to_proto.go @@ -20,27 +20,27 @@ import ( "github.com/conduitio/conduit-commons/opencdc" opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" sdk "github.com/conduitio/conduit-processor-sdk" - procproto "github.com/conduitio/conduit-processor-sdk/internal/proto/processor/v1" + processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" "google.golang.org/protobuf/proto" ) func _() { // An "invalid array index" compiler error signifies that the constant values have changed. var validationTypes [1]struct{} - _ = validationTypes[int(sdk.ValidationTypeRequired)-int(procproto.Specify_Parameter_Validation_TYPE_REQUIRED)] - _ = validationTypes[int(sdk.ValidationTypeRegex)-int(procproto.Specify_Parameter_Validation_TYPE_REGEX)] - _ = validationTypes[int(sdk.ValidationTypeInclusion)-int(procproto.Specify_Parameter_Validation_TYPE_INCLUSION)] - _ = validationTypes[int(sdk.ValidationTypeExclusion)-int(procproto.Specify_Parameter_Validation_TYPE_EXCLUSION)] - _ = validationTypes[int(sdk.ValidationTypeLessThan)-int(procproto.Specify_Parameter_Validation_TYPE_LESS_THAN)] - _ = validationTypes[int(sdk.ValidationTypeGreaterThan)-int(procproto.Specify_Parameter_Validation_TYPE_GREATER_THAN)] + _ = validationTypes[int(sdk.ValidationTypeRequired)-int(processorv1.Specify_Parameter_Validation_TYPE_REQUIRED)] + _ = validationTypes[int(sdk.ValidationTypeRegex)-int(processorv1.Specify_Parameter_Validation_TYPE_REGEX)] + _ = validationTypes[int(sdk.ValidationTypeInclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_INCLUSION)] + _ = validationTypes[int(sdk.ValidationTypeExclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_EXCLUSION)] + _ = validationTypes[int(sdk.ValidationTypeLessThan)-int(processorv1.Specify_Parameter_Validation_TYPE_LESS_THAN)] + _ = validationTypes[int(sdk.ValidationTypeGreaterThan)-int(processorv1.Specify_Parameter_Validation_TYPE_GREATER_THAN)] var paramTypes [1]struct{} - _ = paramTypes[int(sdk.ParameterTypeInt)-int(procproto.Specify_Parameter_TYPE_INT)] - _ = paramTypes[int(sdk.ParameterTypeFloat)-int(procproto.Specify_Parameter_TYPE_FLOAT)] - _ = paramTypes[int(sdk.ParameterTypeBool)-int(procproto.Specify_Parameter_TYPE_BOOL)] - _ = paramTypes[int(sdk.ParameterTypeString)-int(procproto.Specify_Parameter_TYPE_STRING)] - _ = paramTypes[int(sdk.ParameterTypeDuration)-int(procproto.Specify_Parameter_TYPE_DURATION)] - _ = paramTypes[int(sdk.ParameterTypeFile)-int(procproto.Specify_Parameter_TYPE_FILE)] + _ = paramTypes[int(sdk.ParameterTypeInt)-int(processorv1.Specify_Parameter_TYPE_INT)] + _ = paramTypes[int(sdk.ParameterTypeFloat)-int(processorv1.Specify_Parameter_TYPE_FLOAT)] + _ = paramTypes[int(sdk.ParameterTypeBool)-int(processorv1.Specify_Parameter_TYPE_BOOL)] + _ = paramTypes[int(sdk.ParameterTypeString)-int(processorv1.Specify_Parameter_TYPE_STRING)] + _ = paramTypes[int(sdk.ParameterTypeDuration)-int(processorv1.Specify_Parameter_TYPE_DURATION)] + _ = paramTypes[int(sdk.ParameterTypeFile)-int(processorv1.Specify_Parameter_TYPE_FILE)] } func MarshalCommand(cmd sdk.Command) ([]byte, error) { @@ -57,30 +57,30 @@ func MarshalCommand(cmd sdk.Command) ([]byte, error) { return bytes, nil } -func protoCommand(cmd sdk.Command) (*procproto.Command, error) { +func protoCommand(cmd sdk.Command) (*processorv1.Command, error) { if cmd == nil { return nil, ErrNilCommand } switch v := cmd.(type) { case *sdk.SpecifyCmd: - return &procproto.Command{ - Command: &procproto.Command_SpecifyCmd{ - SpecifyCmd: &procproto.Specify_Command{}, + return &processorv1.Command{ + Command: &processorv1.Command_SpecifyCmd{ + SpecifyCmd: &processorv1.Specify_Command{}, }, }, nil case *sdk.ConfigureCmd: - return &procproto.Command{ - Command: &procproto.Command_ConfigureCmd{ - ConfigureCmd: &procproto.Configure_Command{ + return &processorv1.Command{ + Command: &processorv1.Command_ConfigureCmd{ + ConfigureCmd: &processorv1.Configure_Command{ Parameters: v.ConfigMap, }, }, }, nil case *sdk.OpenCmd: - return &procproto.Command{ - Command: &procproto.Command_OpenCmd{ - OpenCmd: &procproto.Open_Command{}, + return &processorv1.Command{ + Command: &processorv1.Command_OpenCmd{ + OpenCmd: &processorv1.Open_Command{}, }, }, nil case *sdk.ProcessCmd: @@ -88,17 +88,17 @@ func protoCommand(cmd sdk.Command) (*procproto.Command, error) { if err != nil { return nil, err } - return &procproto.Command{ - Command: &procproto.Command_ProcessCmd{ - ProcessCmd: &procproto.Process_Command{ + return &processorv1.Command{ + Command: &processorv1.Command_ProcessCmd{ + ProcessCmd: &processorv1.Process_Command{ Records: recs, }, }, }, nil case *sdk.TeardownCmd: - return &procproto.Command{ - Command: &procproto.Command_TeardownCmd{ - TeardownCmd: &procproto.Teardown_Command{}, + return &processorv1.Command{ + Command: &processorv1.Command_TeardownCmd{ + TeardownCmd: &processorv1.Teardown_Command{}, }, }, nil default: @@ -111,11 +111,11 @@ func MarshalCommandResponse(resp sdk.CommandResponse) ([]byte, error) { return nil, ErrNilCommand } - protoResp := &procproto.CommandResponse{} + protoResp := &processorv1.CommandResponse{} switch v := resp.(type) { case *sdk.SpecifyResponse: - protoResp.Response = &procproto.CommandResponse_SpecifyResp{ - SpecifyResp: &procproto.Specify_Response{ + protoResp.Response = &processorv1.CommandResponse_SpecifyResp{ + SpecifyResp: &processorv1.Specify_Response{ Name: v.Specification.Name, Summary: v.Specification.Summary, Description: v.Specification.Description, @@ -126,14 +126,14 @@ func MarshalCommandResponse(resp sdk.CommandResponse) ([]byte, error) { }, } case *sdk.ConfigureResponse: - protoResp.Response = &procproto.CommandResponse_ConfigureResp{ - ConfigureResp: &procproto.Configure_Response{ + protoResp.Response = &processorv1.CommandResponse_ConfigureResp{ + ConfigureResp: &processorv1.Configure_Response{ Err: errorToString(v.Err), }, } case *sdk.OpenResponse: - protoResp.Response = &procproto.CommandResponse_OpenResp{ - OpenResp: &procproto.Open_Response{ + protoResp.Response = &processorv1.CommandResponse_OpenResp{ + OpenResp: &processorv1.Open_Response{ Err: errorToString(v.Err), }, } @@ -142,14 +142,14 @@ func MarshalCommandResponse(resp sdk.CommandResponse) ([]byte, error) { if err != nil { return nil, err } - protoResp.Response = &procproto.CommandResponse_ProcessResp{ - ProcessResp: &procproto.Process_Response{ + protoResp.Response = &processorv1.CommandResponse_ProcessResp{ + ProcessResp: &processorv1.Process_Response{ Records: recs, }, } case *sdk.TeardownResponse: - protoResp.Response = &procproto.CommandResponse_TeardownResp{ - TeardownResp: &procproto.Teardown_Response{ + protoResp.Response = &processorv1.CommandResponse_TeardownResp{ + TeardownResp: &processorv1.Teardown_Response{ Err: errorToString(v.Err), }, } @@ -173,13 +173,13 @@ func errorToString(err error) string { return err.Error() } -func protoSpecificationParams(in map[string]sdk.Parameter) map[string]*procproto.Specify_Parameter { - out := make(map[string]*procproto.Specify_Parameter, len(in)) +func protoSpecificationParams(in map[string]sdk.Parameter) map[string]*processorv1.Specify_Parameter { + out := make(map[string]*processorv1.Specify_Parameter, len(in)) for name, param := range in { - out[name] = &procproto.Specify_Parameter{ + out[name] = &processorv1.Specify_Parameter{ Default: param.Default, Description: param.Description, - Type: procproto.Specify_Parameter_Type(param.Type), + Type: processorv1.Specify_Parameter_Type(param.Type), Validations: protoSpecValidations(param.Validations), } } @@ -187,15 +187,15 @@ func protoSpecificationParams(in map[string]sdk.Parameter) map[string]*procproto return out } -func protoSpecValidations(in []sdk.Validation) []*procproto.Specify_Parameter_Validation { +func protoSpecValidations(in []sdk.Validation) []*processorv1.Specify_Parameter_Validation { if in == nil { return nil } - out := make([]*procproto.Specify_Parameter_Validation, len(in)) + out := make([]*processorv1.Specify_Parameter_Validation, len(in)) for i, v := range in { - out[i] = &procproto.Specify_Parameter_Validation{ - Type: procproto.Specify_Parameter_Validation_Type(v.Type), + out[i] = &processorv1.Specify_Parameter_Validation{ + Type: processorv1.Specify_Parameter_Validation_Type(v.Type), Value: v.Value, } } @@ -203,14 +203,14 @@ func protoSpecValidations(in []sdk.Validation) []*procproto.Specify_Parameter_Va return out } -func protoProcessedRecords(in []sdk.ProcessedRecord) ([]*procproto.Process_ProcessedRecord, error) { +func protoProcessedRecords(in []sdk.ProcessedRecord) ([]*processorv1.Process_ProcessedRecord, error) { if in == nil { return nil, nil } - out := make([]*procproto.Process_ProcessedRecord, len(in)) + out := make([]*processorv1.Process_ProcessedRecord, len(in)) for i, rec := range in { - outRec := &procproto.Process_ProcessedRecord{} + outRec := &processorv1.Process_ProcessedRecord{} // todo handle nil switch v := rec.(type) { case sdk.SingleRecord: @@ -219,14 +219,14 @@ func protoProcessedRecords(in []sdk.ProcessedRecord) ([]*procproto.Process_Proce if err != nil { return nil, fmt.Errorf("failed converting record %v to proto: %w", i, err) } - outRec.Record = &procproto.Process_ProcessedRecord_SingleRecord{ + outRec.Record = &processorv1.Process_ProcessedRecord_SingleRecord{ SingleRecord: protoRec, } case sdk.FilterRecord: - outRec.Record = &procproto.Process_ProcessedRecord_FilterRecord{} + outRec.Record = &processorv1.Process_ProcessedRecord_FilterRecord{} case sdk.ErrorRecord: - outRec.Record = &procproto.Process_ProcessedRecord_ErrorRecord{ - ErrorRecord: &procproto.Process_ErrorRecord{ + outRec.Record = &processorv1.Process_ProcessedRecord_ErrorRecord{ + ErrorRecord: &processorv1.Process_ErrorRecord{ // todo check if v.Err is nil by mistake Err: v.Err.Error(), }, diff --git a/serde/serde.go b/serde/serde.go index d7b78b4..7a57dc4 100644 --- a/serde/serde.go +++ b/serde/serde.go @@ -16,15 +16,15 @@ package serde import ( sdk "github.com/conduitio/conduit-processor-sdk" - "github.com/conduitio/conduit-processor-sdk/internal/proto" + proto2 "github.com/conduitio/conduit-processor-sdk/proto" ) func MarshalCommand(resp sdk.Command) ([]byte, error) { //nolint:wrapcheck // a wrapper function to be used in Conduit - return proto.MarshalCommand(resp) + return proto2.MarshalCommand(resp) } func UnmarshalCommandResponse(bytes []byte) (sdk.CommandResponse, error) { //nolint:wrapcheck // a wrapper function to be used in Conduit - return proto.UnmarshalCommandResponse(bytes) + return proto2.UnmarshalCommandResponse(bytes) } From 226921f633d1ecba2f3195ad928d5ad327e53333 Mon Sep 17 00:00:00 2001 From: Haris Osmanagic Date: Thu, 4 Jan 2024 19:32:25 +0100 Subject: [PATCH 09/17] add buf action --- .github/workflows/buf.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/buf.yml diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml new file mode 100644 index 0000000..64b939e --- /dev/null +++ b/.github/workflows/buf.yml @@ -0,0 +1,39 @@ +name: buf + +on: + push: + branches: [ main ] + pull_request: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: bufbuild/buf-setup-action@v1 + - uses: bufbuild/buf-lint-action@v1 + with: + input: 'proto' + + # We need to fetch main so we can compare breaking changes against whatever is in main right now. + - name: Fetch origin/main + run: git fetch --no-tags --prune --depth=1 origin +refs/heads/main:refs/remotes/origin/main + + - uses: bufbuild/buf-breaking-action@v1 + with: + input: 'proto' + against: '.git#branch=origin/main,subdir=proto' + + # Push buf module to the buf schema registry, but only if the validate action succeeded and if the action is running + # on branch main. + push: + runs-on: ubuntu-latest + needs: validate + if: ${{ github.ref == 'refs/heads/main' }} + steps: + - uses: actions/checkout@v4 + - uses: bufbuild/buf-setup-action@v1 + - uses: bufbuild/buf-push-action@v1 + with: + input: 'proto' + buf_token: ${{ secrets.BUF_TOKEN }} From 6b04be233d2b1ee764925bc3e903654e1c3f2221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 14:38:42 +0100 Subject: [PATCH 10/17] refactor and simplify command handling, use proto structs directly, reuse buffer --- command.go | 120 ---- errors.go | 38 -- internal/wasm/command_actions.go | 69 --- internal/wasm/imports_stub.go | 30 - internal/wasm/memory.go | 55 -- mock/processor.go | 113 ---- processor.go | 2 - proto/buf.gen.yaml | 2 +- proto/command_protobuf_test.go | 207 ------- proto/from_proto.go | 211 ------- proto/processor/v1/processor.pb.go | 909 +++++++++++++++-------------- proto/processor/v1/processor.proto | 62 +- proto/to_proto.go | 254 -------- run.go | 157 +++++ run/run.go | 51 -- serde/serde.go | 30 - wasm/command.go | 70 +++ proto/errors.go => wasm/doc.go | 13 +- wasm/errors.go | 82 +++ {internal/wasm => wasm}/imports.go | 0 20 files changed, 818 insertions(+), 1657 deletions(-) delete mode 100644 command.go delete mode 100644 errors.go delete mode 100644 internal/wasm/command_actions.go delete mode 100644 internal/wasm/imports_stub.go delete mode 100644 internal/wasm/memory.go delete mode 100644 mock/processor.go delete mode 100644 proto/command_protobuf_test.go delete mode 100644 proto/from_proto.go delete mode 100644 proto/to_proto.go create mode 100644 run.go delete mode 100644 run/run.go delete mode 100644 serde/serde.go create mode 100644 wasm/command.go rename proto/errors.go => wasm/doc.go (75%) create mode 100644 wasm/errors.go rename {internal/wasm => wasm}/imports.go (100%) diff --git a/command.go b/command.go deleted file mode 100644 index 6f8660d..0000000 --- a/command.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sdk - -import ( - "context" - - "github.com/conduitio/conduit-commons/opencdc" -) - -type Command interface { - Execute(context.Context, Processor) CommandResponse -} - -type CommandResponse interface { - Error() error - isCommandResponse() -} - -type SpecifyCmd struct{} - -func (c *SpecifyCmd) Execute(_ context.Context, plugin Processor) CommandResponse { - spec, err := plugin.Specification() - return &SpecifyResponse{Specification: spec, Err: err} -} - -type SpecifyResponse struct { - Specification Specification - Err error -} - -func (r *SpecifyResponse) Error() error { - return r.Err -} - -func (r *SpecifyResponse) isCommandResponse() {} - -type ConfigureCmd struct { - ConfigMap map[string]string -} - -func (c *ConfigureCmd) Execute(ctx context.Context, p Processor) CommandResponse { - return &ConfigureResponse{ - Err: p.Configure(ctx, c.ConfigMap), - } -} - -type ConfigureResponse struct { - Err error -} - -func (r *ConfigureResponse) Error() error { - return r.Err -} - -func (r *ConfigureResponse) isCommandResponse() {} - -type OpenCmd struct{} - -func (c *OpenCmd) Execute(ctx context.Context, p Processor) CommandResponse { - return &OpenResponse{Err: p.Open(ctx)} -} - -type OpenResponse struct { - Err error -} - -func (r *OpenResponse) Error() error { - return r.Err -} - -func (r *OpenResponse) isCommandResponse() {} - -type ProcessCmd struct { - Records []opencdc.Record -} - -func (c *ProcessCmd) Execute(ctx context.Context, plugin Processor) CommandResponse { - return &ProcessResponse{Records: plugin.Process(ctx, c.Records)} -} - -type ProcessResponse struct { - Records []ProcessedRecord -} - -func (r *ProcessResponse) Error() error { - return nil -} - -func (r *ProcessResponse) isCommandResponse() {} - -type TeardownCmd struct{} - -func (c *TeardownCmd) Execute(ctx context.Context, p Processor) CommandResponse { - return &TeardownResponse{ - Err: p.Teardown(ctx), - } -} - -type TeardownResponse struct { - Err error -} - -func (r *TeardownResponse) Error() error { - return r.Err -} - -func (r *TeardownResponse) isCommandResponse() {} diff --git a/errors.go b/errors.go deleted file mode 100644 index 3fe3e0c..0000000 --- a/errors.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package sdk - -import ( - "errors" - "math" -) - -var ( - // ErrorCodeStart is the smallest error code which the host (i.e. Conduit) can send. - // The imported function _nextCommand returns an uint32 value - // that is either the number of bytes actually written or an error code. - // Because of that, we're reserving a range of error codes. - ErrorCodeStart = ErrCodeNoMoreCommands - - ErrCodeInsufficientSize = math.MaxUint32 - uint32(1) - ErrCodeFailedGettingCommand = math.MaxUint32 - uint32(2) - ErrCodeMemoryOutOfRange = math.MaxUint32 - uint32(3) - ErrCodeNoMoreCommands = math.MaxUint32 - uint32(4) -) - -var ( - ErrNextCommand = errors.New("failed getting next command") - ErrNoMoreCommands = errors.New("no more commands") -) diff --git a/internal/wasm/command_actions.go b/internal/wasm/command_actions.go deleted file mode 100644 index d14d9de..0000000 --- a/internal/wasm/command_actions.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package wasm - -import ( - "fmt" - - sdk "github.com/conduitio/conduit-processor-sdk" - "github.com/conduitio/conduit-processor-sdk/proto" -) - -var defaultCommandSize = uint32(1024) - -// NextCommand retrieves the next command from Conduit. -func NextCommand() (sdk.Command, error) { - // allocate some memory for Conduit to write the command - // we're allocating some memory in advance, so that - // we don't need to introduce another call just to - // get the amount of memory which is needed. - ptr, cleanup := allocate(defaultCommandSize) - defer cleanup() - - // request Conduit to write the command to the given allocation - fmt.Println("getting next command") - resp := _nextCommand(ptr, defaultCommandSize) - if resp > sdk.ErrorCodeStart { // error codes - // todo if more memory is needed, allocate it - // https://github.com/ConduitIO/conduit-processor-sdk/issues/6 - fmt.Printf("got error code: %v\n", resp) - - if resp == sdk.ErrCodeNoMoreCommands { - return nil, fmt.Errorf("error code %v: %w", resp, sdk.ErrNoMoreCommands) - } - return nil, fmt.Errorf("error code %v: %w", resp, sdk.ErrNextCommand) - } - - // parse the command - cmd, err := proto.UnmarshalCommand(ptrToByteArray(ptr, resp)) - if err != nil { - return nil, fmt.Errorf("failed unmarshalling command: %w", err) - } - - return cmd, nil -} - -func Reply(resp sdk.CommandResponse) error { - bytes, err := proto.MarshalCommandResponse(resp) - if err != nil { - return fmt.Errorf("failed marshalling CommandResponse to bytes: %w", err) - } - - ptr, cleanup := Write(bytes) - defer cleanup() - _reply(ptr, uint32(len(bytes))) - - return nil -} diff --git a/internal/wasm/imports_stub.go b/internal/wasm/imports_stub.go deleted file mode 100644 index 7152a84..0000000 --- a/internal/wasm/imports_stub.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// The functions in this file are stubs of the functions defined -// in imports.go. -// They exist to make it possible to test, lint -// or generally run the code in a non-WASM environment. - -//go:build !wasm - -package wasm - -func _nextCommand(_, _ uint32) uint32 { - panic("stub") -} - -func _reply(_, _ uint32) { - panic("stub") -} diff --git a/internal/wasm/memory.go b/internal/wasm/memory.go deleted file mode 100644 index 6722636..0000000 --- a/internal/wasm/memory.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package wasm - -import ( - "fmt" - "unsafe" -) - -var allocations = make(map[uintptr][]byte) - -func allocate(size uint32) (uint32, func()) { - fmt.Printf("allocating %v bytes\n", size) - - return Write(make([]byte, size)) -} - -func free(ptr unsafe.Pointer) { - if ptr == nil { - return - } - - fmt.Printf("freeing up memory at %v\n", ptr) - if _, ok := allocations[uintptr(ptr)]; ok { - delete(allocations, uintptr(ptr)) - } else { - panic("free: invalid pointer") - } -} - -func ptrToByteArray(ptr uint32, size uint32) []byte { - return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(ptr))), size) -} - -func Write(bytes []byte) (uint32, func()) { - fmt.Printf("writing %v bytes to memory\n", len(bytes)) - ptr := unsafe.Pointer(&bytes[0]) - allocations[uintptr(ptr)] = bytes - - return uint32(uintptr(ptr)), func() { - free(ptr) - } -} diff --git a/mock/processor.go b/mock/processor.go deleted file mode 100644 index dad7d33..0000000 --- a/mock/processor.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by MockGen. DO NOT EDIT. -// Source: github.com/conduitio/conduit-processor-sdk (interfaces: Processor) -// -// Generated by this command: -// -// mockgen -destination=mock/processor.go -package=mock -mock_names=Processor=Processor . Processor -// - -// Package mock is a generated GoMock package. -package mock - -import ( - context "context" - reflect "reflect" - - opencdc "github.com/conduitio/conduit-commons/opencdc" - sdk "github.com/conduitio/conduit-processor-sdk" - gomock "go.uber.org/mock/gomock" -) - -// Processor is a mock of Processor interface. -type Processor struct { - ctrl *gomock.Controller - recorder *ProcessorMockRecorder -} - -// ProcessorMockRecorder is the mock recorder for Processor. -type ProcessorMockRecorder struct { - mock *Processor -} - -// NewProcessor creates a new mock instance. -func NewProcessor(ctrl *gomock.Controller) *Processor { - mock := &Processor{ctrl: ctrl} - mock.recorder = &ProcessorMockRecorder{mock} - return mock -} - -// EXPECT returns an object that allows the caller to indicate expected use. -func (m *Processor) EXPECT() *ProcessorMockRecorder { - return m.recorder -} - -// Configure mocks base method. -func (m *Processor) Configure(arg0 context.Context, arg1 map[string]string) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Configure", arg0, arg1) - ret0, _ := ret[0].(error) - return ret0 -} - -// Configure indicates an expected call of Configure. -func (mr *ProcessorMockRecorder) Configure(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Configure", reflect.TypeOf((*Processor)(nil).Configure), arg0, arg1) -} - -// Open mocks base method. -func (m *Processor) Open(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Open", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Open indicates an expected call of Open. -func (mr *ProcessorMockRecorder) Open(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Open", reflect.TypeOf((*Processor)(nil).Open), arg0) -} - -// Process mocks base method. -func (m *Processor) Process(arg0 context.Context, arg1 []opencdc.Record) []sdk.ProcessedRecord { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Process", arg0, arg1) - ret0, _ := ret[0].([]sdk.ProcessedRecord) - return ret0 -} - -// Process indicates an expected call of Process. -func (mr *ProcessorMockRecorder) Process(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Process", reflect.TypeOf((*Processor)(nil).Process), arg0, arg1) -} - -// Specification mocks base method. -func (m *Processor) Specification() (sdk.Specification, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Specification") - ret0, _ := ret[0].(sdk.Specification) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// Specification indicates an expected call of Specification. -func (mr *ProcessorMockRecorder) Specification() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Specification", reflect.TypeOf((*Processor)(nil).Specification)) -} - -// Teardown mocks base method. -func (m *Processor) Teardown(arg0 context.Context) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Teardown", arg0) - ret0, _ := ret[0].(error) - return ret0 -} - -// Teardown indicates an expected call of Teardown. -func (mr *ProcessorMockRecorder) Teardown(arg0 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Teardown", reflect.TypeOf((*Processor)(nil).Teardown), arg0) -} diff --git a/processor.go b/processor.go index 54a4987..1f003ac 100644 --- a/processor.go +++ b/processor.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:generate mockgen -destination=mock/processor.go -package=mock -mock_names=Processor=Processor . Processor - package sdk import ( diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 6ded409..b212081 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -6,7 +6,7 @@ managed: except: - buf.build/conduitio/conduit-commons plugins: - - plugin: buf.build/protocolbuffers/go:v1.31.0 + - plugin: buf.build/protocolbuffers/go:v1.32.0 out: . opt: - paths=source_relative diff --git a/proto/command_protobuf_test.go b/proto/command_protobuf_test.go deleted file mode 100644 index 857b610..0000000 --- a/proto/command_protobuf_test.go +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package proto - -import ( - "errors" - "testing" - - "github.com/conduitio/conduit-commons/opencdc" - sdk "github.com/conduitio/conduit-processor-sdk" - "github.com/matryer/is" -) - -func TestCommand_Marshal_Unmarshal(t *testing.T) { - is := is.New(t) - - testCases := []struct { - name string - input sdk.Command - }{ - { - name: "specify", - input: &sdk.SpecifyCmd{}, - }, - { - name: "configure", - input: &sdk.ConfigureCmd{ - ConfigMap: map[string]string{ - "url": "https://conduit.io", - }, - }, - }, - { - name: "open", - input: &sdk.OpenCmd{}, - }, - { - name: "process with no records", - input: &sdk.ProcessCmd{}, - }, - { - name: "process with records", - input: &sdk.ProcessCmd{ - Records: []opencdc.Record{ - { - Position: opencdc.Position("test-post"), - Operation: opencdc.OperationCreate, - Metadata: opencdc.Metadata{ - "meta1": "v1", - }, - Key: opencdc.RawData("test-key"), - Payload: opencdc.Change{ - After: opencdc.StructuredData{ - "key1": "value1", - }, - }, - }, - }, - }, - }, - { - name: "teardown", - input: &sdk.TeardownCmd{}, - }, - } - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - bytes, err := MarshalCommand(tt.input) - is.NoErr(err) - - cmd, err := UnmarshalCommand(bytes) - is.NoErr(err) - is.Equal(tt.input, cmd) - }) - } -} - -func TestCommandResponse_Marshal_Unmarshal(t *testing.T) { - is := is.New(t) - - testCases := []struct { - name string - input sdk.CommandResponse - }{ - { - name: "specify", - input: &sdk.SpecifyResponse{ - Specification: sdk.Specification{ - Name: "test-connector", - Summary: "A test connector", - Description: "A test connector", - Version: "v2.3.4", - Author: "Conduit", - Parameters: map[string]sdk.Parameter{ - "required-param": { - Default: "", - Type: sdk.ParameterTypeString, - Description: "Service URL", - Validations: []sdk.Validation{ - { - Type: sdk.ValidationTypeRequired, - }, - }, - }, - "duration-param": { - Default: "1m", - Type: sdk.ParameterTypeDuration, - Description: "Timeout", - Validations: nil, - }, - "inclusion-param": { - Default: "snapshot", - Type: sdk.ParameterTypeDuration, - Description: "Timeout", - Validations: []sdk.Validation{ - { - Type: sdk.ValidationTypeInclusion, - Value: "snapshot,cdc", - }, - }, - }, - }, - }, - }, - }, - { - name: "specify with error", - input: &sdk.SpecifyResponse{ - Err: errors.New("specify error"), - }, - }, - { - name: "configure", - input: &sdk.ConfigureResponse{}, - }, - { - name: "configure with error", - input: &sdk.ConfigureResponse{ - Err: errors.New("configure error"), - }, - }, - { - name: "open", - input: &sdk.OpenResponse{ - Err: errors.New("open error"), - }, - }, - { - name: "process response with no records", - input: &sdk.ProcessResponse{}, - }, - { - name: "process with records", - input: &sdk.ProcessResponse{ - Records: []sdk.ProcessedRecord{ - sdk.SingleRecord{ - Position: opencdc.Position("test-post"), - Operation: opencdc.OperationCreate, - Metadata: opencdc.Metadata{ - "meta1": "v1", - }, - Key: opencdc.RawData("test-key"), - Payload: opencdc.Change{ - After: opencdc.StructuredData{ - "key1": "value1", - }, - }, - }, - }, - }, - }, - { - name: "teardown", - input: &sdk.TeardownResponse{}, - }, - { - name: "teardown with error", - input: &sdk.TeardownResponse{ - Err: errors.New("teardown error"), - }, - }, - } - - for _, tt := range testCases { - t.Run(tt.name, func(t *testing.T) { - bytes, err := MarshalCommandResponse(tt.input) - is.NoErr(err) - - got, err := UnmarshalCommandResponse(bytes) - is.NoErr(err) - is.Equal(tt.input, got) - }) - } -} diff --git a/proto/from_proto.go b/proto/from_proto.go deleted file mode 100644 index 8a5e2bd..0000000 --- a/proto/from_proto.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package proto - -import ( - "errors" - "fmt" - - "github.com/conduitio/conduit-commons/opencdc" - opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" - sdk "github.com/conduitio/conduit-processor-sdk" - processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" - "google.golang.org/protobuf/proto" -) - -func UnmarshalCommand(bytes []byte) (sdk.Command, error) { - protoCmd := &processorv1.Command{} - if err := proto.Unmarshal(bytes, protoCmd); err != nil { - return nil, fmt.Errorf("failed unmarshalling %v proto bytes into a command: %w", len(bytes), err) - } - - return sdkCommand(protoCmd) -} - -func sdkCommand(cmd *processorv1.Command) (sdk.Command, error) { - c := cmd.GetCommand() - if c == nil { - return nil, ErrNilCommand - } - - switch v := c.(type) { - case *processorv1.Command_SpecifyCmd: - return &sdk.SpecifyCmd{}, nil - case *processorv1.Command_ConfigureCmd: - return &sdk.ConfigureCmd{ConfigMap: v.ConfigureCmd.Parameters}, nil - case *processorv1.Command_OpenCmd: - return &sdk.OpenCmd{}, nil - case *processorv1.Command_ProcessCmd: - records, err := opencdcRecords(v.ProcessCmd.Records) - if err != nil { - return nil, err - } - return &sdk.ProcessCmd{ - Records: records, - }, nil - case *processorv1.Command_TeardownCmd: - return &sdk.TeardownCmd{}, nil - default: - return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) - } -} - -func UnmarshalCommandResponse(bytes []byte) (sdk.CommandResponse, error) { - protoCmd := &processorv1.CommandResponse{} - if err := proto.Unmarshal(bytes, protoCmd); err != nil { - return nil, fmt.Errorf("failed unmarshalling proto bytes: %w", err) - } - - return sdkCommandResponse(protoCmd) -} - -func sdkCommandResponse(cr *processorv1.CommandResponse) (sdk.CommandResponse, error) { - resp := cr.GetResponse() - if resp == nil { - return nil, ErrNilCommand - } - - switch v := resp.(type) { - case *processorv1.CommandResponse_SpecifyResp: - return &sdk.SpecifyResponse{ - Specification: sdkSpec(v.SpecifyResp), - Err: errorFromString(v.SpecifyResp.Err), - }, nil - case *processorv1.CommandResponse_ConfigureResp: - return &sdk.ConfigureResponse{ - Err: errorFromString(v.ConfigureResp.Err), - }, nil - case *processorv1.CommandResponse_OpenResp: - return &sdk.OpenResponse{ - Err: errorFromString(v.OpenResp.Err), - }, nil - case *processorv1.CommandResponse_ProcessResp: - records, err := sdkProcessedRecord(v.ProcessResp.Records) - if err != nil { - return nil, err - } - return &sdk.ProcessResponse{ - Records: records, - }, nil - case *processorv1.CommandResponse_TeardownResp: - return &sdk.TeardownResponse{ - Err: errorFromString(v.TeardownResp.Err), - }, nil - default: - return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) - } -} - -func errorFromString(s string) error { - if s == "" { - return nil - } - - return errors.New(s) //nolint:goerr113 // the only way to deal with errors with protobuf -} - -func sdkProcessedRecord(in []*processorv1.Process_ProcessedRecord) ([]sdk.ProcessedRecord, error) { - if in == nil { - return nil, nil - } - - out := make([]sdk.ProcessedRecord, len(in)) - for i, r := range in { - switch v := r.GetRecord().(type) { - case *processorv1.Process_ProcessedRecord_SingleRecord: - rec := opencdc.Record{} - err := rec.FromProto(v.SingleRecord) - if err != nil { - return nil, fmt.Errorf("failed converting proto record to OpenCDC record: %w", err) - } - out[i] = sdk.SingleRecord(rec) - case *processorv1.Process_ProcessedRecord_FilterRecord: - out[i] = sdk.FilterRecord{} - case *processorv1.Process_ProcessedRecord_ErrorRecord: - out[i] = sdk.ErrorRecord{ - //nolint:goerr113 // the only way to deal with errors with protobuf - Err: errors.New(v.ErrorRecord.Err), - } - default: - return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) - } - } - - return out, nil -} - -func sdkSpec(resp *processorv1.Specify_Response) sdk.Specification { - return sdk.Specification{ - Name: resp.Name, - Summary: resp.Summary, - Description: resp.Description, - Version: resp.Version, - Author: resp.Author, - Parameters: sdkSpecParams(resp.Parameters), - } -} - -func sdkSpecParams(in map[string]*processorv1.Specify_Parameter) map[string]sdk.Parameter { - if in == nil { - return nil - } - - out := make(map[string]sdk.Parameter, len(in)) - for name, param := range in { - out[name] = sdk.Parameter{ - Default: param.Default, - Type: sdk.ParameterType(param.Type), - Description: param.Description, - Validations: sdkParamValidations(param.Validations), - } - } - - return out -} - -func sdkParamValidations(in []*processorv1.Specify_Parameter_Validation) []sdk.Validation { - if in == nil { - return nil - } - - out := make([]sdk.Validation, len(in)) - for i, v := range in { - out[i] = sdk.Validation{ - Type: sdk.ValidationType(v.Type), - Value: v.Value, - } - } - - return out -} - -func opencdcRecords(in []*opencdcv1.Record) ([]opencdc.Record, error) { - if in == nil { - return nil, nil - } - - outRecs := make([]opencdc.Record, len(in)) - for i, protoRec := range in { - rec := opencdc.Record{} - err := rec.FromProto(protoRec) - if err != nil { - return nil, fmt.Errorf("failed converting protobuf record at index %v to OpenCDC record: %w", i, err) - } - - outRecs[i] = rec - } - - return outRecs, nil -} diff --git a/proto/processor/v1/processor.pb.go b/proto/processor/v1/processor.pb.go index ceff6b3..5275171 100644 --- a/proto/processor/v1/processor.pb.go +++ b/proto/processor/v1/processor.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.32.0 // protoc (unknown) // source: processor/v1/processor.proto @@ -156,23 +156,23 @@ func (Specify_Parameter_Validation_Type) EnumDescriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 2, 0, 0} } -type Command struct { +type CommandRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to Command: + // Types that are assignable to Request: // - // *Command_SpecifyCmd - // *Command_ConfigureCmd - // *Command_OpenCmd - // *Command_ProcessCmd - // *Command_TeardownCmd - Command isCommand_Command `protobuf_oneof:"command"` + // *CommandRequest_Specify + // *CommandRequest_Configure + // *CommandRequest_Open + // *CommandRequest_Process + // *CommandRequest_Teardown + Request isCommandRequest_Request `protobuf_oneof:"request"` } -func (x *Command) Reset() { - *x = Command{} +func (x *CommandRequest) Reset() { + *x = CommandRequest{} if protoimpl.UnsafeEnabled { mi := &file_processor_v1_processor_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -180,13 +180,13 @@ func (x *Command) Reset() { } } -func (x *Command) String() string { +func (x *CommandRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Command) ProtoMessage() {} +func (*CommandRequest) ProtoMessage() {} -func (x *Command) ProtoReflect() protoreflect.Message { +func (x *CommandRequest) ProtoReflect() protoreflect.Message { mi := &file_processor_v1_processor_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -198,86 +198,86 @@ func (x *Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Command.ProtoReflect.Descriptor instead. -func (*Command) Descriptor() ([]byte, []int) { +// Deprecated: Use CommandRequest.ProtoReflect.Descriptor instead. +func (*CommandRequest) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{0} } -func (m *Command) GetCommand() isCommand_Command { +func (m *CommandRequest) GetRequest() isCommandRequest_Request { if m != nil { - return m.Command + return m.Request } return nil } -func (x *Command) GetSpecifyCmd() *Specify_Command { - if x, ok := x.GetCommand().(*Command_SpecifyCmd); ok { - return x.SpecifyCmd +func (x *CommandRequest) GetSpecify() *Specify_Request { + if x, ok := x.GetRequest().(*CommandRequest_Specify); ok { + return x.Specify } return nil } -func (x *Command) GetConfigureCmd() *Configure_Command { - if x, ok := x.GetCommand().(*Command_ConfigureCmd); ok { - return x.ConfigureCmd +func (x *CommandRequest) GetConfigure() *Configure_Request { + if x, ok := x.GetRequest().(*CommandRequest_Configure); ok { + return x.Configure } return nil } -func (x *Command) GetOpenCmd() *Open_Command { - if x, ok := x.GetCommand().(*Command_OpenCmd); ok { - return x.OpenCmd +func (x *CommandRequest) GetOpen() *Open_Request { + if x, ok := x.GetRequest().(*CommandRequest_Open); ok { + return x.Open } return nil } -func (x *Command) GetProcessCmd() *Process_Command { - if x, ok := x.GetCommand().(*Command_ProcessCmd); ok { - return x.ProcessCmd +func (x *CommandRequest) GetProcess() *Process_Request { + if x, ok := x.GetRequest().(*CommandRequest_Process); ok { + return x.Process } return nil } -func (x *Command) GetTeardownCmd() *Teardown_Command { - if x, ok := x.GetCommand().(*Command_TeardownCmd); ok { - return x.TeardownCmd +func (x *CommandRequest) GetTeardown() *Teardown_Request { + if x, ok := x.GetRequest().(*CommandRequest_Teardown); ok { + return x.Teardown } return nil } -type isCommand_Command interface { - isCommand_Command() +type isCommandRequest_Request interface { + isCommandRequest_Request() } -type Command_SpecifyCmd struct { - SpecifyCmd *Specify_Command `protobuf:"bytes,1,opt,name=specify_cmd,json=specifyCmd,proto3,oneof"` +type CommandRequest_Specify struct { + Specify *Specify_Request `protobuf:"bytes,1,opt,name=specify,proto3,oneof"` } -type Command_ConfigureCmd struct { - ConfigureCmd *Configure_Command `protobuf:"bytes,2,opt,name=configure_cmd,json=configureCmd,proto3,oneof"` +type CommandRequest_Configure struct { + Configure *Configure_Request `protobuf:"bytes,2,opt,name=configure,proto3,oneof"` } -type Command_OpenCmd struct { - OpenCmd *Open_Command `protobuf:"bytes,3,opt,name=open_cmd,json=openCmd,proto3,oneof"` +type CommandRequest_Open struct { + Open *Open_Request `protobuf:"bytes,3,opt,name=open,proto3,oneof"` } -type Command_ProcessCmd struct { - ProcessCmd *Process_Command `protobuf:"bytes,4,opt,name=process_cmd,json=processCmd,proto3,oneof"` +type CommandRequest_Process struct { + Process *Process_Request `protobuf:"bytes,4,opt,name=process,proto3,oneof"` } -type Command_TeardownCmd struct { - TeardownCmd *Teardown_Command `protobuf:"bytes,5,opt,name=teardown_cmd,json=teardownCmd,proto3,oneof"` +type CommandRequest_Teardown struct { + Teardown *Teardown_Request `protobuf:"bytes,5,opt,name=teardown,proto3,oneof"` } -func (*Command_SpecifyCmd) isCommand_Command() {} +func (*CommandRequest_Specify) isCommandRequest_Request() {} -func (*Command_ConfigureCmd) isCommand_Command() {} +func (*CommandRequest_Configure) isCommandRequest_Request() {} -func (*Command_OpenCmd) isCommand_Command() {} +func (*CommandRequest_Open) isCommandRequest_Request() {} -func (*Command_ProcessCmd) isCommand_Command() {} +func (*CommandRequest_Process) isCommandRequest_Request() {} -func (*Command_TeardownCmd) isCommand_Command() {} +func (*CommandRequest_Teardown) isCommandRequest_Request() {} type CommandResponse struct { state protoimpl.MessageState @@ -286,11 +286,12 @@ type CommandResponse struct { // Types that are assignable to Response: // - // *CommandResponse_SpecifyResp - // *CommandResponse_ConfigureResp - // *CommandResponse_OpenResp - // *CommandResponse_ProcessResp - // *CommandResponse_TeardownResp + // *CommandResponse_Error + // *CommandResponse_Specify + // *CommandResponse_Configure + // *CommandResponse_Open + // *CommandResponse_Process + // *CommandResponse_Teardown Response isCommandResponse_Response `protobuf_oneof:"response"` } @@ -333,37 +334,44 @@ func (m *CommandResponse) GetResponse() isCommandResponse_Response { return nil } -func (x *CommandResponse) GetSpecifyResp() *Specify_Response { - if x, ok := x.GetResponse().(*CommandResponse_SpecifyResp); ok { - return x.SpecifyResp +func (x *CommandResponse) GetError() *ErrorResponse { + if x, ok := x.GetResponse().(*CommandResponse_Error); ok { + return x.Error } return nil } -func (x *CommandResponse) GetConfigureResp() *Configure_Response { - if x, ok := x.GetResponse().(*CommandResponse_ConfigureResp); ok { - return x.ConfigureResp +func (x *CommandResponse) GetSpecify() *Specify_Response { + if x, ok := x.GetResponse().(*CommandResponse_Specify); ok { + return x.Specify } return nil } -func (x *CommandResponse) GetOpenResp() *Open_Response { - if x, ok := x.GetResponse().(*CommandResponse_OpenResp); ok { - return x.OpenResp +func (x *CommandResponse) GetConfigure() *Configure_Response { + if x, ok := x.GetResponse().(*CommandResponse_Configure); ok { + return x.Configure } return nil } -func (x *CommandResponse) GetProcessResp() *Process_Response { - if x, ok := x.GetResponse().(*CommandResponse_ProcessResp); ok { - return x.ProcessResp +func (x *CommandResponse) GetOpen() *Open_Response { + if x, ok := x.GetResponse().(*CommandResponse_Open); ok { + return x.Open } return nil } -func (x *CommandResponse) GetTeardownResp() *Teardown_Response { - if x, ok := x.GetResponse().(*CommandResponse_TeardownResp); ok { - return x.TeardownResp +func (x *CommandResponse) GetProcess() *Process_Response { + if x, ok := x.GetResponse().(*CommandResponse_Process); ok { + return x.Process + } + return nil +} + +func (x *CommandResponse) GetTeardown() *Teardown_Response { + if x, ok := x.GetResponse().(*CommandResponse_Teardown); ok { + return x.Teardown } return nil } @@ -372,35 +380,41 @@ type isCommandResponse_Response interface { isCommandResponse_Response() } -type CommandResponse_SpecifyResp struct { - SpecifyResp *Specify_Response `protobuf:"bytes,1,opt,name=specify_resp,json=specifyResp,proto3,oneof"` +type CommandResponse_Error struct { + Error *ErrorResponse `protobuf:"bytes,1,opt,name=error,proto3,oneof"` +} + +type CommandResponse_Specify struct { + Specify *Specify_Response `protobuf:"bytes,2,opt,name=specify,proto3,oneof"` } -type CommandResponse_ConfigureResp struct { - ConfigureResp *Configure_Response `protobuf:"bytes,2,opt,name=configure_resp,json=configureResp,proto3,oneof"` +type CommandResponse_Configure struct { + Configure *Configure_Response `protobuf:"bytes,3,opt,name=configure,proto3,oneof"` } -type CommandResponse_OpenResp struct { - OpenResp *Open_Response `protobuf:"bytes,3,opt,name=open_resp,json=openResp,proto3,oneof"` +type CommandResponse_Open struct { + Open *Open_Response `protobuf:"bytes,4,opt,name=open,proto3,oneof"` } -type CommandResponse_ProcessResp struct { - ProcessResp *Process_Response `protobuf:"bytes,4,opt,name=process_resp,json=processResp,proto3,oneof"` +type CommandResponse_Process struct { + Process *Process_Response `protobuf:"bytes,5,opt,name=process,proto3,oneof"` } -type CommandResponse_TeardownResp struct { - TeardownResp *Teardown_Response `protobuf:"bytes,5,opt,name=teardown_resp,json=teardownResp,proto3,oneof"` +type CommandResponse_Teardown struct { + Teardown *Teardown_Response `protobuf:"bytes,6,opt,name=teardown,proto3,oneof"` } -func (*CommandResponse_SpecifyResp) isCommandResponse_Response() {} +func (*CommandResponse_Error) isCommandResponse_Response() {} + +func (*CommandResponse_Specify) isCommandResponse_Response() {} -func (*CommandResponse_ConfigureResp) isCommandResponse_Response() {} +func (*CommandResponse_Configure) isCommandResponse_Response() {} -func (*CommandResponse_OpenResp) isCommandResponse_Response() {} +func (*CommandResponse_Open) isCommandResponse_Response() {} -func (*CommandResponse_ProcessResp) isCommandResponse_Response() {} +func (*CommandResponse_Process) isCommandResponse_Response() {} -func (*CommandResponse_TeardownResp) isCommandResponse_Response() {} +func (*CommandResponse_Teardown) isCommandResponse_Response() {} type Specify struct { state protoimpl.MessageState @@ -592,14 +606,17 @@ func (*Teardown) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{6} } -type Specify_Command struct { +type ErrorResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } -func (x *Specify_Command) Reset() { - *x = Specify_Command{} +func (x *ErrorResponse) Reset() { + *x = ErrorResponse{} if protoimpl.UnsafeEnabled { mi := &file_processor_v1_processor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -607,13 +624,13 @@ func (x *Specify_Command) Reset() { } } -func (x *Specify_Command) String() string { +func (x *ErrorResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Specify_Command) ProtoMessage() {} +func (*ErrorResponse) ProtoMessage() {} -func (x *Specify_Command) ProtoReflect() protoreflect.Message { +func (x *ErrorResponse) ProtoReflect() protoreflect.Message { mi := &file_processor_v1_processor_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -625,8 +642,60 @@ func (x *Specify_Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Specify_Command.ProtoReflect.Descriptor instead. -func (*Specify_Command) Descriptor() ([]byte, []int) { +// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead. +func (*ErrorResponse) Descriptor() ([]byte, []int) { + return file_processor_v1_processor_proto_rawDescGZIP(), []int{7} +} + +func (x *ErrorResponse) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *ErrorResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +type Specify_Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Specify_Request) Reset() { + *x = Specify_Request{} + if protoimpl.UnsafeEnabled { + mi := &file_processor_v1_processor_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Specify_Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Specify_Request) ProtoMessage() {} + +func (x *Specify_Request) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_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 Specify_Request.ProtoReflect.Descriptor instead. +func (*Specify_Request) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{2, 0} } @@ -650,15 +719,14 @@ type Specify_Response struct { // Author declares the entity that created or maintains this plugin. Author string `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"` // A map that describes parameters available for configuring the - // destination plugin. + // processor plugin. Parameters map[string]*Specify_Parameter `protobuf:"bytes,6,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Err string `protobuf:"bytes,7,opt,name=err,proto3" json:"err,omitempty"` } func (x *Specify_Response) Reset() { *x = Specify_Response{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[8] + mi := &file_processor_v1_processor_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -671,7 +739,7 @@ func (x *Specify_Response) String() string { func (*Specify_Response) ProtoMessage() {} func (x *Specify_Response) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[8] + mi := &file_processor_v1_processor_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -729,13 +797,6 @@ func (x *Specify_Response) GetParameters() map[string]*Specify_Parameter { return nil } -func (x *Specify_Response) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - // Parameter describes a single config parameter. type Specify_Parameter struct { state protoimpl.MessageState @@ -756,7 +817,7 @@ type Specify_Parameter struct { func (x *Specify_Parameter) Reset() { *x = Specify_Parameter{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[9] + mi := &file_processor_v1_processor_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -769,7 +830,7 @@ func (x *Specify_Parameter) String() string { func (*Specify_Parameter) ProtoMessage() {} func (x *Specify_Parameter) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[9] + mi := &file_processor_v1_processor_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +889,7 @@ type Specify_Parameter_Validation struct { func (x *Specify_Parameter_Validation) Reset() { *x = Specify_Parameter_Validation{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[11] + mi := &file_processor_v1_processor_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -841,7 +902,7 @@ func (x *Specify_Parameter_Validation) String() string { func (*Specify_Parameter_Validation) ProtoMessage() {} func (x *Specify_Parameter_Validation) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[11] + mi := &file_processor_v1_processor_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -871,7 +932,7 @@ func (x *Specify_Parameter_Validation) GetValue() string { return "" } -type Configure_Command struct { +type Configure_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -879,23 +940,23 @@ type Configure_Command struct { Parameters map[string]string `protobuf:"bytes,1,rep,name=parameters,proto3" json:"parameters,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (x *Configure_Command) Reset() { - *x = Configure_Command{} +func (x *Configure_Request) Reset() { + *x = Configure_Request{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[12] + mi := &file_processor_v1_processor_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Configure_Command) String() string { +func (x *Configure_Request) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Configure_Command) ProtoMessage() {} +func (*Configure_Request) ProtoMessage() {} -func (x *Configure_Command) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[12] +func (x *Configure_Request) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -906,12 +967,12 @@ func (x *Configure_Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Configure_Command.ProtoReflect.Descriptor instead. -func (*Configure_Command) Descriptor() ([]byte, []int) { +// Deprecated: Use Configure_Request.ProtoReflect.Descriptor instead. +func (*Configure_Request) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{3, 0} } -func (x *Configure_Command) GetParameters() map[string]string { +func (x *Configure_Request) GetParameters() map[string]string { if x != nil { return x.Parameters } @@ -922,14 +983,12 @@ type Configure_Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` } func (x *Configure_Response) Reset() { *x = Configure_Response{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[13] + mi := &file_processor_v1_processor_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -942,7 +1001,7 @@ func (x *Configure_Response) String() string { func (*Configure_Response) ProtoMessage() {} func (x *Configure_Response) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[13] + mi := &file_processor_v1_processor_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -958,36 +1017,29 @@ func (*Configure_Response) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{3, 1} } -func (x *Configure_Response) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - -type Open_Command struct { +type Open_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *Open_Command) Reset() { - *x = Open_Command{} +func (x *Open_Request) Reset() { + *x = Open_Request{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[15] + mi := &file_processor_v1_processor_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Open_Command) String() string { +func (x *Open_Request) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Open_Command) ProtoMessage() {} +func (*Open_Request) ProtoMessage() {} -func (x *Open_Command) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[15] +func (x *Open_Request) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -998,8 +1050,8 @@ func (x *Open_Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Open_Command.ProtoReflect.Descriptor instead. -func (*Open_Command) Descriptor() ([]byte, []int) { +// Deprecated: Use Open_Request.ProtoReflect.Descriptor instead. +func (*Open_Request) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{4, 0} } @@ -1007,14 +1059,12 @@ type Open_Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` } func (x *Open_Response) Reset() { *x = Open_Response{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[16] + mi := &file_processor_v1_processor_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1027,7 +1077,7 @@ func (x *Open_Response) String() string { func (*Open_Response) ProtoMessage() {} func (x *Open_Response) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[16] + mi := &file_processor_v1_processor_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1043,14 +1093,7 @@ func (*Open_Response) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{4, 1} } -func (x *Open_Response) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - -type Process_Command struct { +type Process_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1058,23 +1101,23 @@ type Process_Command struct { Records []*v1.Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` } -func (x *Process_Command) Reset() { - *x = Process_Command{} +func (x *Process_Request) Reset() { + *x = Process_Request{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[17] + mi := &file_processor_v1_processor_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Process_Command) String() string { +func (x *Process_Request) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Process_Command) ProtoMessage() {} +func (*Process_Request) ProtoMessage() {} -func (x *Process_Command) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[17] +func (x *Process_Request) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1085,12 +1128,12 @@ func (x *Process_Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Process_Command.ProtoReflect.Descriptor instead. -func (*Process_Command) Descriptor() ([]byte, []int) { +// Deprecated: Use Process_Request.ProtoReflect.Descriptor instead. +func (*Process_Request) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 0} } -func (x *Process_Command) GetRecords() []*v1.Record { +func (x *Process_Request) GetRecords() []*v1.Record { if x != nil { return x.Records } @@ -1108,7 +1151,7 @@ type Process_Response struct { func (x *Process_Response) Reset() { *x = Process_Response{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[18] + mi := &file_processor_v1_processor_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1121,7 +1164,7 @@ func (x *Process_Response) String() string { func (*Process_Response) ProtoMessage() {} func (x *Process_Response) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[18] + mi := &file_processor_v1_processor_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1160,7 +1203,7 @@ type Process_ProcessedRecord struct { func (x *Process_ProcessedRecord) Reset() { *x = Process_ProcessedRecord{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[19] + mi := &file_processor_v1_processor_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1173,7 +1216,7 @@ func (x *Process_ProcessedRecord) String() string { func (*Process_ProcessedRecord) ProtoMessage() {} func (x *Process_ProcessedRecord) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[19] + mi := &file_processor_v1_processor_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1248,7 +1291,7 @@ type Process_FilterRecord struct { func (x *Process_FilterRecord) Reset() { *x = Process_FilterRecord{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[20] + mi := &file_processor_v1_processor_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1261,7 +1304,7 @@ func (x *Process_FilterRecord) String() string { func (*Process_FilterRecord) ProtoMessage() {} func (x *Process_FilterRecord) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[20] + mi := &file_processor_v1_processor_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1281,14 +1324,12 @@ type Process_ErrorRecord struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` } func (x *Process_ErrorRecord) Reset() { *x = Process_ErrorRecord{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[21] + mi := &file_processor_v1_processor_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1342,7 @@ func (x *Process_ErrorRecord) String() string { func (*Process_ErrorRecord) ProtoMessage() {} func (x *Process_ErrorRecord) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[21] + mi := &file_processor_v1_processor_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1317,36 +1358,29 @@ func (*Process_ErrorRecord) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 4} } -func (x *Process_ErrorRecord) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - -type Teardown_Command struct { +type Teardown_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields } -func (x *Teardown_Command) Reset() { - *x = Teardown_Command{} +func (x *Teardown_Request) Reset() { + *x = Teardown_Request{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[22] + mi := &file_processor_v1_processor_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Teardown_Command) String() string { +func (x *Teardown_Request) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Teardown_Command) ProtoMessage() {} +func (*Teardown_Request) ProtoMessage() {} -func (x *Teardown_Command) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[22] +func (x *Teardown_Request) ProtoReflect() protoreflect.Message { + mi := &file_processor_v1_processor_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1357,8 +1391,8 @@ func (x *Teardown_Command) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Teardown_Command.ProtoReflect.Descriptor instead. -func (*Teardown_Command) Descriptor() ([]byte, []int) { +// Deprecated: Use Teardown_Request.ProtoReflect.Descriptor instead. +func (*Teardown_Request) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{6, 0} } @@ -1366,14 +1400,12 @@ type Teardown_Response struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - - Err string `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"` } func (x *Teardown_Response) Reset() { *x = Teardown_Response{} if protoimpl.UnsafeEnabled { - mi := &file_processor_v1_processor_proto_msgTypes[23] + mi := &file_processor_v1_processor_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1386,7 +1418,7 @@ func (x *Teardown_Response) String() string { func (*Teardown_Response) ProtoMessage() {} func (x *Teardown_Response) ProtoReflect() protoreflect.Message { - mi := &file_processor_v1_processor_proto_msgTypes[23] + mi := &file_processor_v1_processor_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1402,13 +1434,6 @@ func (*Teardown_Response) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{6, 1} } -func (x *Teardown_Response) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - var File_processor_v1_processor_proto protoreflect.FileDescriptor var file_processor_v1_processor_proto_rawDesc = []byte{ @@ -1416,171 +1441,168 @@ var file_processor_v1_processor_proto_rawDesc = []byte{ 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x1a, 0x18, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x5f, 0x63, 0x6d, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x79, 0x43, 0x6d, 0x64, 0x12, 0x46, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x65, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0c, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x6d, 0x64, 0x12, 0x37, 0x0a, 0x08, - 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x70, - 0x65, 0x6e, 0x43, 0x6d, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x0a, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x43, 0x6d, 0x64, 0x12, 0x43, 0x0a, 0x0c, 0x74, 0x65, 0x61, 0x72, 0x64, - 0x6f, 0x77, 0x6e, 0x5f, 0x63, 0x6d, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, - 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, - 0x0b, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x43, 0x6d, 0x64, 0x42, 0x09, 0x0a, 0x07, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0xf6, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x49, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x65, - 0x73, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x09, 0x6f, - 0x70, 0x65, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, - 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x6f, - 0x70, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x43, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, - 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0d, - 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x18, 0x05, 0x20, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x02, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x07, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x79, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x73, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x79, 0x12, 0x3f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x39, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x3c, 0x0a, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, + 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xfe, 0x02, 0x0a, 0x0f, + 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x33, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, + 0x12, 0x40, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, + 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x70, 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xb4, 0x07, 0x0a, 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x1a, 0x09, 0x0a, 0x07, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0xce, 0x02, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, - 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, - 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, - 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x1a, 0x5e, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xcc, 0x04, 0x0a, 0x09, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x0b, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfc, 0x01, 0x0a, 0x0a, 0x56, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, - 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, - 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, - 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, - 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, - 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x53, - 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, - 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x06, 0x22, 0x7c, 0x0a, 0x04, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, - 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, - 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, - 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x55, 0x52, - 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x22, 0xc5, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x65, 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x12, 0x4f, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, + 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x07, 0x0a, + 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0xbc, 0x02, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, + 0x72, 0x73, 0x1a, 0x5e, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, - 0x2f, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, - 0x22, 0xac, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, - 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x39, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, - 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0xcc, 0x04, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, + 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, + 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, + 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfc, 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, + 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, + 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, + 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, + 0x4e, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x45, + 0x58, 0x10, 0x06, 0x22, 0x7c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02, + 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x03, + 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, + 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, + 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, + 0x06, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x1a, + 0x99, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0a, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x0a, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, + 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9a, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, + 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, + 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x39, 0x0a, 0x0d, + 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, + 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x12, 0x46, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, - 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x46, 0x0a, 0x0c, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, - 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, - 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x1f, - 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, - 0x33, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x1a, 0x1c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x65, 0x72, 0x72, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x69, - 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, - 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0d, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x22, 0x21, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x1a, + 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, + 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1596,63 +1618,65 @@ func file_processor_v1_processor_proto_rawDescGZIP() []byte { } var file_processor_v1_processor_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_processor_v1_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_processor_v1_processor_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_processor_v1_processor_proto_goTypes = []interface{}{ (Specify_Parameter_Type)(0), // 0: processor.v1.Specify.Parameter.Type (Specify_Parameter_Validation_Type)(0), // 1: processor.v1.Specify.Parameter.Validation.Type - (*Command)(nil), // 2: processor.v1.Command + (*CommandRequest)(nil), // 2: processor.v1.CommandRequest (*CommandResponse)(nil), // 3: processor.v1.CommandResponse (*Specify)(nil), // 4: processor.v1.Specify (*Configure)(nil), // 5: processor.v1.Configure (*Open)(nil), // 6: processor.v1.Open (*Process)(nil), // 7: processor.v1.Process (*Teardown)(nil), // 8: processor.v1.Teardown - (*Specify_Command)(nil), // 9: processor.v1.Specify.Command - (*Specify_Response)(nil), // 10: processor.v1.Specify.Response - (*Specify_Parameter)(nil), // 11: processor.v1.Specify.Parameter - nil, // 12: processor.v1.Specify.Response.ParametersEntry - (*Specify_Parameter_Validation)(nil), // 13: processor.v1.Specify.Parameter.Validation - (*Configure_Command)(nil), // 14: processor.v1.Configure.Command - (*Configure_Response)(nil), // 15: processor.v1.Configure.Response - nil, // 16: processor.v1.Configure.Command.ParametersEntry - (*Open_Command)(nil), // 17: processor.v1.Open.Command - (*Open_Response)(nil), // 18: processor.v1.Open.Response - (*Process_Command)(nil), // 19: processor.v1.Process.Command - (*Process_Response)(nil), // 20: processor.v1.Process.Response - (*Process_ProcessedRecord)(nil), // 21: processor.v1.Process.ProcessedRecord - (*Process_FilterRecord)(nil), // 22: processor.v1.Process.FilterRecord - (*Process_ErrorRecord)(nil), // 23: processor.v1.Process.ErrorRecord - (*Teardown_Command)(nil), // 24: processor.v1.Teardown.Command - (*Teardown_Response)(nil), // 25: processor.v1.Teardown.Response - (*v1.Record)(nil), // 26: opencdc.v1.Record + (*ErrorResponse)(nil), // 9: processor.v1.ErrorResponse + (*Specify_Request)(nil), // 10: processor.v1.Specify.Request + (*Specify_Response)(nil), // 11: processor.v1.Specify.Response + (*Specify_Parameter)(nil), // 12: processor.v1.Specify.Parameter + nil, // 13: processor.v1.Specify.Response.ParametersEntry + (*Specify_Parameter_Validation)(nil), // 14: processor.v1.Specify.Parameter.Validation + (*Configure_Request)(nil), // 15: processor.v1.Configure.Request + (*Configure_Response)(nil), // 16: processor.v1.Configure.Response + nil, // 17: processor.v1.Configure.Request.ParametersEntry + (*Open_Request)(nil), // 18: processor.v1.Open.Request + (*Open_Response)(nil), // 19: processor.v1.Open.Response + (*Process_Request)(nil), // 20: processor.v1.Process.Request + (*Process_Response)(nil), // 21: processor.v1.Process.Response + (*Process_ProcessedRecord)(nil), // 22: processor.v1.Process.ProcessedRecord + (*Process_FilterRecord)(nil), // 23: processor.v1.Process.FilterRecord + (*Process_ErrorRecord)(nil), // 24: processor.v1.Process.ErrorRecord + (*Teardown_Request)(nil), // 25: processor.v1.Teardown.Request + (*Teardown_Response)(nil), // 26: processor.v1.Teardown.Response + (*v1.Record)(nil), // 27: opencdc.v1.Record } var file_processor_v1_processor_proto_depIdxs = []int32{ - 9, // 0: processor.v1.Command.specify_cmd:type_name -> processor.v1.Specify.Command - 14, // 1: processor.v1.Command.configure_cmd:type_name -> processor.v1.Configure.Command - 17, // 2: processor.v1.Command.open_cmd:type_name -> processor.v1.Open.Command - 19, // 3: processor.v1.Command.process_cmd:type_name -> processor.v1.Process.Command - 24, // 4: processor.v1.Command.teardown_cmd:type_name -> processor.v1.Teardown.Command - 10, // 5: processor.v1.CommandResponse.specify_resp:type_name -> processor.v1.Specify.Response - 15, // 6: processor.v1.CommandResponse.configure_resp:type_name -> processor.v1.Configure.Response - 18, // 7: processor.v1.CommandResponse.open_resp:type_name -> processor.v1.Open.Response - 20, // 8: processor.v1.CommandResponse.process_resp:type_name -> processor.v1.Process.Response - 25, // 9: processor.v1.CommandResponse.teardown_resp:type_name -> processor.v1.Teardown.Response - 12, // 10: processor.v1.Specify.Response.parameters:type_name -> processor.v1.Specify.Response.ParametersEntry - 0, // 11: processor.v1.Specify.Parameter.type:type_name -> processor.v1.Specify.Parameter.Type - 13, // 12: processor.v1.Specify.Parameter.validations:type_name -> processor.v1.Specify.Parameter.Validation - 11, // 13: processor.v1.Specify.Response.ParametersEntry.value:type_name -> processor.v1.Specify.Parameter - 1, // 14: processor.v1.Specify.Parameter.Validation.type:type_name -> processor.v1.Specify.Parameter.Validation.Type - 16, // 15: processor.v1.Configure.Command.parameters:type_name -> processor.v1.Configure.Command.ParametersEntry - 26, // 16: processor.v1.Process.Command.records:type_name -> opencdc.v1.Record - 21, // 17: processor.v1.Process.Response.records:type_name -> processor.v1.Process.ProcessedRecord - 26, // 18: processor.v1.Process.ProcessedRecord.single_record:type_name -> opencdc.v1.Record - 22, // 19: processor.v1.Process.ProcessedRecord.filter_record:type_name -> processor.v1.Process.FilterRecord - 23, // 20: processor.v1.Process.ProcessedRecord.error_record:type_name -> processor.v1.Process.ErrorRecord - 21, // [21:21] is the sub-list for method output_type - 21, // [21:21] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 10, // 0: processor.v1.CommandRequest.specify:type_name -> processor.v1.Specify.Request + 15, // 1: processor.v1.CommandRequest.configure:type_name -> processor.v1.Configure.Request + 18, // 2: processor.v1.CommandRequest.open:type_name -> processor.v1.Open.Request + 20, // 3: processor.v1.CommandRequest.process:type_name -> processor.v1.Process.Request + 25, // 4: processor.v1.CommandRequest.teardown:type_name -> processor.v1.Teardown.Request + 9, // 5: processor.v1.CommandResponse.error:type_name -> processor.v1.ErrorResponse + 11, // 6: processor.v1.CommandResponse.specify:type_name -> processor.v1.Specify.Response + 16, // 7: processor.v1.CommandResponse.configure:type_name -> processor.v1.Configure.Response + 19, // 8: processor.v1.CommandResponse.open:type_name -> processor.v1.Open.Response + 21, // 9: processor.v1.CommandResponse.process:type_name -> processor.v1.Process.Response + 26, // 10: processor.v1.CommandResponse.teardown:type_name -> processor.v1.Teardown.Response + 13, // 11: processor.v1.Specify.Response.parameters:type_name -> processor.v1.Specify.Response.ParametersEntry + 0, // 12: processor.v1.Specify.Parameter.type:type_name -> processor.v1.Specify.Parameter.Type + 14, // 13: processor.v1.Specify.Parameter.validations:type_name -> processor.v1.Specify.Parameter.Validation + 12, // 14: processor.v1.Specify.Response.ParametersEntry.value:type_name -> processor.v1.Specify.Parameter + 1, // 15: processor.v1.Specify.Parameter.Validation.type:type_name -> processor.v1.Specify.Parameter.Validation.Type + 17, // 16: processor.v1.Configure.Request.parameters:type_name -> processor.v1.Configure.Request.ParametersEntry + 27, // 17: processor.v1.Process.Request.records:type_name -> opencdc.v1.Record + 22, // 18: processor.v1.Process.Response.records:type_name -> processor.v1.Process.ProcessedRecord + 27, // 19: processor.v1.Process.ProcessedRecord.single_record:type_name -> opencdc.v1.Record + 23, // 20: processor.v1.Process.ProcessedRecord.filter_record:type_name -> processor.v1.Process.FilterRecord + 24, // 21: processor.v1.Process.ProcessedRecord.error_record:type_name -> processor.v1.Process.ErrorRecord + 22, // [22:22] is the sub-list for method output_type + 22, // [22:22] is the sub-list for method input_type + 22, // [22:22] is the sub-list for extension type_name + 22, // [22:22] is the sub-list for extension extendee + 0, // [0:22] is the sub-list for field type_name } func init() { file_processor_v1_processor_proto_init() } @@ -1662,7 +1686,7 @@ func file_processor_v1_processor_proto_init() { } if !protoimpl.UnsafeEnabled { file_processor_v1_processor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Command); i { + switch v := v.(*CommandRequest); i { case 0: return &v.state case 1: @@ -1746,7 +1770,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Specify_Command); i { + switch v := v.(*ErrorResponse); i { case 0: return &v.state case 1: @@ -1758,7 +1782,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Specify_Response); i { + switch v := v.(*Specify_Request); i { case 0: return &v.state case 1: @@ -1770,7 +1794,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Specify_Parameter); i { + switch v := v.(*Specify_Response); i { case 0: return &v.state case 1: @@ -1781,8 +1805,8 @@ func file_processor_v1_processor_proto_init() { return nil } } - file_processor_v1_processor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Specify_Parameter_Validation); i { + file_processor_v1_processor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Specify_Parameter); i { case 0: return &v.state case 1: @@ -1794,7 +1818,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Configure_Command); i { + switch v := v.(*Specify_Parameter_Validation); i { case 0: return &v.state case 1: @@ -1806,7 +1830,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Configure_Response); i { + switch v := v.(*Configure_Request); i { case 0: return &v.state case 1: @@ -1817,8 +1841,8 @@ func file_processor_v1_processor_proto_init() { return nil } } - file_processor_v1_processor_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Open_Command); i { + file_processor_v1_processor_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Configure_Response); i { case 0: return &v.state case 1: @@ -1830,7 +1854,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Open_Response); i { + switch v := v.(*Open_Request); i { case 0: return &v.state case 1: @@ -1842,7 +1866,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process_Command); i { + switch v := v.(*Open_Response); i { case 0: return &v.state case 1: @@ -1854,7 +1878,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process_Response); i { + switch v := v.(*Process_Request); i { case 0: return &v.state case 1: @@ -1866,7 +1890,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process_ProcessedRecord); i { + switch v := v.(*Process_Response); i { case 0: return &v.state case 1: @@ -1878,7 +1902,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process_FilterRecord); i { + switch v := v.(*Process_ProcessedRecord); i { case 0: return &v.state case 1: @@ -1890,7 +1914,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process_ErrorRecord); i { + switch v := v.(*Process_FilterRecord); i { case 0: return &v.state case 1: @@ -1902,7 +1926,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Teardown_Command); i { + switch v := v.(*Process_ErrorRecord); i { case 0: return &v.state case 1: @@ -1914,6 +1938,18 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Teardown_Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_processor_v1_processor_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Teardown_Response); i { case 0: return &v.state @@ -1927,20 +1963,21 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Command_SpecifyCmd)(nil), - (*Command_ConfigureCmd)(nil), - (*Command_OpenCmd)(nil), - (*Command_ProcessCmd)(nil), - (*Command_TeardownCmd)(nil), + (*CommandRequest_Specify)(nil), + (*CommandRequest_Configure)(nil), + (*CommandRequest_Open)(nil), + (*CommandRequest_Process)(nil), + (*CommandRequest_Teardown)(nil), } file_processor_v1_processor_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*CommandResponse_SpecifyResp)(nil), - (*CommandResponse_ConfigureResp)(nil), - (*CommandResponse_OpenResp)(nil), - (*CommandResponse_ProcessResp)(nil), - (*CommandResponse_TeardownResp)(nil), - } - file_processor_v1_processor_proto_msgTypes[19].OneofWrappers = []interface{}{ + (*CommandResponse_Error)(nil), + (*CommandResponse_Specify)(nil), + (*CommandResponse_Configure)(nil), + (*CommandResponse_Open)(nil), + (*CommandResponse_Process)(nil), + (*CommandResponse_Teardown)(nil), + } + file_processor_v1_processor_proto_msgTypes[20].OneofWrappers = []interface{}{ (*Process_ProcessedRecord_SingleRecord)(nil), (*Process_ProcessedRecord_FilterRecord)(nil), (*Process_ProcessedRecord_ErrorRecord)(nil), @@ -1951,7 +1988,7 @@ func file_processor_v1_processor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_processor_v1_processor_proto_rawDesc, NumEnums: 2, - NumMessages: 24, + NumMessages: 25, NumExtensions: 0, NumServices: 0, }, diff --git a/proto/processor/v1/processor.proto b/proto/processor/v1/processor.proto index bc5eb09..25be2e5 100644 --- a/proto/processor/v1/processor.proto +++ b/proto/processor/v1/processor.proto @@ -4,27 +4,29 @@ package processor.v1; import "opencdc/v1/opencdc.proto"; -message Command { - oneof command { - Specify.Command specify_cmd = 1; - Configure.Command configure_cmd = 2; - Open.Command open_cmd = 3; - Process.Command process_cmd = 4; - Teardown.Command teardown_cmd = 5; +message CommandRequest { + oneof request { + Specify.Request specify = 1; + Configure.Request configure = 2; + Open.Request open = 3; + Process.Request process = 4; + Teardown.Request teardown = 5; } } message CommandResponse { oneof response { - Specify.Response specify_resp = 1; - Configure.Response configure_resp = 2; - Open.Response open_resp = 3; - Process.Response process_resp = 4; - Teardown.Response teardown_resp = 5; + ErrorResponse error = 1; + + Specify.Response specify = 2; + Configure.Response configure = 3; + Open.Response open = 4; + Process.Response process = 5; + Teardown.Response teardown = 6; } } message Specify { - message Command {} + message Request {} message Response { // Name is the name of the plugin. string name = 1; @@ -41,9 +43,8 @@ message Specify { // Author declares the entity that created or maintains this plugin. string author = 5; // A map that describes parameters available for configuring the - // destination plugin. + // processor plugin. map parameters = 6; - string err = 7; } // Parameter describes a single config parameter. @@ -102,29 +103,26 @@ message Specify { } message Configure { - message Command { + message Request { map parameters = 1; } - message Response { - string err = 1; - } + message Response {} } message Open { - message Command {} - message Response { - string err = 1; - } + message Request {} + message Response {} } message Process { - message Command { + message Request { repeated opencdc.v1.Record records = 1; } message Response { repeated ProcessedRecord records = 1; } + message ProcessedRecord { oneof record { opencdc.v1.Record single_record = 1; @@ -132,15 +130,17 @@ message Process { ErrorRecord error_record = 3; } } + message FilterRecord {} - message ErrorRecord { - string err = 1; - } + message ErrorRecord {} } message Teardown { - message Command {} - message Response { - string err = 1; - } + message Request {} + message Response {} +} + +message ErrorResponse { + uint32 code = 1; + string message = 2; } \ No newline at end of file diff --git a/proto/to_proto.go b/proto/to_proto.go deleted file mode 100644 index 092e9c7..0000000 --- a/proto/to_proto.go +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package proto - -import ( - "fmt" - - "github.com/conduitio/conduit-commons/opencdc" - opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" - sdk "github.com/conduitio/conduit-processor-sdk" - processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" - "google.golang.org/protobuf/proto" -) - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - var validationTypes [1]struct{} - _ = validationTypes[int(sdk.ValidationTypeRequired)-int(processorv1.Specify_Parameter_Validation_TYPE_REQUIRED)] - _ = validationTypes[int(sdk.ValidationTypeRegex)-int(processorv1.Specify_Parameter_Validation_TYPE_REGEX)] - _ = validationTypes[int(sdk.ValidationTypeInclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_INCLUSION)] - _ = validationTypes[int(sdk.ValidationTypeExclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_EXCLUSION)] - _ = validationTypes[int(sdk.ValidationTypeLessThan)-int(processorv1.Specify_Parameter_Validation_TYPE_LESS_THAN)] - _ = validationTypes[int(sdk.ValidationTypeGreaterThan)-int(processorv1.Specify_Parameter_Validation_TYPE_GREATER_THAN)] - - var paramTypes [1]struct{} - _ = paramTypes[int(sdk.ParameterTypeInt)-int(processorv1.Specify_Parameter_TYPE_INT)] - _ = paramTypes[int(sdk.ParameterTypeFloat)-int(processorv1.Specify_Parameter_TYPE_FLOAT)] - _ = paramTypes[int(sdk.ParameterTypeBool)-int(processorv1.Specify_Parameter_TYPE_BOOL)] - _ = paramTypes[int(sdk.ParameterTypeString)-int(processorv1.Specify_Parameter_TYPE_STRING)] - _ = paramTypes[int(sdk.ParameterTypeDuration)-int(processorv1.Specify_Parameter_TYPE_DURATION)] - _ = paramTypes[int(sdk.ParameterTypeFile)-int(processorv1.Specify_Parameter_TYPE_FILE)] -} - -func MarshalCommand(cmd sdk.Command) ([]byte, error) { - protoCmd, err := protoCommand(cmd) - if err != nil { - return nil, fmt.Errorf("failed converting sdk.Command to protobuf command: %w", err) - } - - bytes, err := proto.Marshal(protoCmd) - if err != nil { - return nil, fmt.Errorf("failed marshalling protobuf command: %w", err) - } - - return bytes, nil -} - -func protoCommand(cmd sdk.Command) (*processorv1.Command, error) { - if cmd == nil { - return nil, ErrNilCommand - } - - switch v := cmd.(type) { - case *sdk.SpecifyCmd: - return &processorv1.Command{ - Command: &processorv1.Command_SpecifyCmd{ - SpecifyCmd: &processorv1.Specify_Command{}, - }, - }, nil - case *sdk.ConfigureCmd: - return &processorv1.Command{ - Command: &processorv1.Command_ConfigureCmd{ - ConfigureCmd: &processorv1.Configure_Command{ - Parameters: v.ConfigMap, - }, - }, - }, nil - case *sdk.OpenCmd: - return &processorv1.Command{ - Command: &processorv1.Command_OpenCmd{ - OpenCmd: &processorv1.Open_Command{}, - }, - }, nil - case *sdk.ProcessCmd: - recs, err := protoRecords(v.Records) - if err != nil { - return nil, err - } - return &processorv1.Command{ - Command: &processorv1.Command_ProcessCmd{ - ProcessCmd: &processorv1.Process_Command{ - Records: recs, - }, - }, - }, nil - case *sdk.TeardownCmd: - return &processorv1.Command{ - Command: &processorv1.Command_TeardownCmd{ - TeardownCmd: &processorv1.Teardown_Command{}, - }, - }, nil - default: - return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) - } -} - -func MarshalCommandResponse(resp sdk.CommandResponse) ([]byte, error) { - if resp == nil { - return nil, ErrNilCommand - } - - protoResp := &processorv1.CommandResponse{} - switch v := resp.(type) { - case *sdk.SpecifyResponse: - protoResp.Response = &processorv1.CommandResponse_SpecifyResp{ - SpecifyResp: &processorv1.Specify_Response{ - Name: v.Specification.Name, - Summary: v.Specification.Summary, - Description: v.Specification.Description, - Version: v.Specification.Version, - Author: v.Specification.Author, - Parameters: protoSpecificationParams(v.Specification.Parameters), - Err: errorToString(v.Err), - }, - } - case *sdk.ConfigureResponse: - protoResp.Response = &processorv1.CommandResponse_ConfigureResp{ - ConfigureResp: &processorv1.Configure_Response{ - Err: errorToString(v.Err), - }, - } - case *sdk.OpenResponse: - protoResp.Response = &processorv1.CommandResponse_OpenResp{ - OpenResp: &processorv1.Open_Response{ - Err: errorToString(v.Err), - }, - } - case *sdk.ProcessResponse: - recs, err := protoProcessedRecords(v.Records) - if err != nil { - return nil, err - } - protoResp.Response = &processorv1.CommandResponse_ProcessResp{ - ProcessResp: &processorv1.Process_Response{ - Records: recs, - }, - } - case *sdk.TeardownResponse: - protoResp.Response = &processorv1.CommandResponse_TeardownResp{ - TeardownResp: &processorv1.Teardown_Response{ - Err: errorToString(v.Err), - }, - } - default: - return nil, fmt.Errorf("%T: %w", v, ErrUnknownType) - } - - bytes, err := proto.Marshal(protoResp) - if err != nil { - return nil, fmt.Errorf("failed unmarshaling bytes into protobuf message: %w", err) - } - - return bytes, nil -} - -func errorToString(err error) string { - if err == nil { - return "" - } - - return err.Error() -} - -func protoSpecificationParams(in map[string]sdk.Parameter) map[string]*processorv1.Specify_Parameter { - out := make(map[string]*processorv1.Specify_Parameter, len(in)) - for name, param := range in { - out[name] = &processorv1.Specify_Parameter{ - Default: param.Default, - Description: param.Description, - Type: processorv1.Specify_Parameter_Type(param.Type), - Validations: protoSpecValidations(param.Validations), - } - } - - return out -} - -func protoSpecValidations(in []sdk.Validation) []*processorv1.Specify_Parameter_Validation { - if in == nil { - return nil - } - - out := make([]*processorv1.Specify_Parameter_Validation, len(in)) - for i, v := range in { - out[i] = &processorv1.Specify_Parameter_Validation{ - Type: processorv1.Specify_Parameter_Validation_Type(v.Type), - Value: v.Value, - } - } - - return out -} - -func protoProcessedRecords(in []sdk.ProcessedRecord) ([]*processorv1.Process_ProcessedRecord, error) { - if in == nil { - return nil, nil - } - - out := make([]*processorv1.Process_ProcessedRecord, len(in)) - for i, rec := range in { - outRec := &processorv1.Process_ProcessedRecord{} - // todo handle nil - switch v := rec.(type) { - case sdk.SingleRecord: - protoRec := &opencdcv1.Record{} - err := opencdc.Record(v).ToProto(protoRec) - if err != nil { - return nil, fmt.Errorf("failed converting record %v to proto: %w", i, err) - } - outRec.Record = &processorv1.Process_ProcessedRecord_SingleRecord{ - SingleRecord: protoRec, - } - case sdk.FilterRecord: - outRec.Record = &processorv1.Process_ProcessedRecord_FilterRecord{} - case sdk.ErrorRecord: - outRec.Record = &processorv1.Process_ProcessedRecord_ErrorRecord{ - ErrorRecord: &processorv1.Process_ErrorRecord{ - // todo check if v.Err is nil by mistake - Err: v.Err.Error(), - }, - } - } - - out[i] = outRec - } - - return out, nil -} - -func protoRecords(records []opencdc.Record) ([]*opencdcv1.Record, error) { - out := make([]*opencdcv1.Record, len(records)) - for i, record := range records { - outRec := &opencdcv1.Record{} - err := record.ToProto(outRec) - if err != nil { - return nil, fmt.Errorf("failed converting record %v to proto: %w", i, err) - } - out[i] = outRec - } - - return out, nil -} diff --git a/run.go b/run.go new file mode 100644 index 0000000..c302dc1 --- /dev/null +++ b/run.go @@ -0,0 +1,157 @@ +// Copyright © 2024 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build wasm + +package sdk + +import ( + "context" + "errors" + "fmt" + "os" + + processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" + "github.com/conduitio/conduit-processor-sdk/wasm" +) + +// Run is the entry-point for a standalone processor. It handles all communication +// with Conduit. It will block forever, or until an error occurs. If an error +// occurs, it will be printed to stderr and the process will exit with a non-zero +// exit code. Otherwise, it will exit with a zero exit code. +// +// A processor plugin needs to call this function in its main function. +func Run(p Processor) { + ctx := context.Background() + var cmd processorv1.CommandRequest + + for { + cmd.Reset() + err := wasm.NextCommand(&cmd) + if err != nil { + if errors.Is(err, wasm.ErrNoMoreCommands) { + os.Exit(0) + } + _, _ = fmt.Fprintf(os.Stderr, "failed retrieving next command: %v", err) + os.Exit(1) + } + + resp := executeCommand(ctx, p, &cmd) + err = wasm.Reply(resp) + if err != nil { + _, _ = fmt.Fprintf(os.Stderr, "failed writing reply: %v\n", err) + os.Exit(1) + } + } +} + +func executeCommand(ctx context.Context, p Processor, cmdReq *processorv1.CommandRequest) *processorv1.CommandResponse { + var resp *processorv1.CommandResponse + var err error + + switch req := cmdReq.GetRequest().(type) { + case *processorv1.CommandRequest_Specify: + resp, err = executeCommandSpecify(ctx, p, req.Specify) + case *processorv1.CommandRequest_Configure: + resp, err = executeCommandConfigure(ctx, p, req.Configure) + case *processorv1.CommandRequest_Open: + resp, err = executeCommandOpen(ctx, p, req.Open) + case *processorv1.CommandRequest_Process: + resp, err = executeCommandProcess(ctx, p, req.Process) + case *processorv1.CommandRequest_Teardown: + resp, err = executeCommandTeardown(ctx, p, req.Teardown) + default: + err = wasm.ErrUnknownCommandRequest + } + + if err != nil { + var wasmErr *wasm.Error + var code uint32 + if errors.As(err, &wasmErr) { + code = wasmErr.ErrCode + } + resp = &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Error{ + Error: &processorv1.ErrorResponse{ + Code: code, + Message: err.Error(), + }, + }, + } + } + + return resp +} + +func executeCommandSpecify(_ context.Context, p Processor, _ *processorv1.Specify_Request) (*processorv1.CommandResponse, error) { + var spec Specification + spec, err := p.Specification() + if err != nil { + return nil, err + } + resp := &processorv1.CommandResponse_Specify{ + Specify: &processorv1.Specify_Response{ + Name: spec.Name, + Summary: spec.Summary, + Description: spec.Description, + Version: spec.Version, + Author: spec.Author, + Parameters: specificationParametersToProto(spec.Parameters), + }, + } + return &processorv1.CommandResponse{Response: resp}, nil +} + +func specificationParametersToProto(in map[string]Parameter) map[string]*processorv1.Specify_Parameter { + out := make(map[string]*processorv1.Specify_Parameter, len(in)) + for name, param := range in { + out[name] = &processorv1.Specify_Parameter{ + Default: param.Default, + Description: param.Description, + Type: processorv1.Specify_Parameter_Type(param.Type), + Validations: specificationValidationsToProto(param.Validations), + } + } + return out +} + +func specificationValidationsToProto(in []Validation) []*processorv1.Specify_Parameter_Validation { + if in == nil { + return nil + } + out := make([]*processorv1.Specify_Parameter_Validation, len(in)) + for i, v := range in { + out[i] = &processorv1.Specify_Parameter_Validation{ + Type: processorv1.Specify_Parameter_Validation_Type(v.Type), + Value: v.Value, + } + } + return out +} + +func executeCommandConfigure(ctx context.Context, p Processor, req *processorv1.Configure_Request) (*processorv1.CommandResponse, error) { + panic("unimplemented") +} + +func executeCommandOpen(ctx context.Context, p Processor, req *processorv1.Open_Request) (*processorv1.CommandResponse, error) { + panic("unimplemented") +} + +func executeCommandProcess(ctx context.Context, p Processor, req *processorv1.Process_Request) (*processorv1.CommandResponse, error) { + panic("unimplemented") +} + +func executeCommandTeardown(ctx context.Context, p Processor, req *processorv1.Teardown_Request) (*processorv1.CommandResponse, error) { + panic("unimplemented") +} diff --git a/run/run.go b/run/run.go deleted file mode 100644 index 07bef37..0000000 --- a/run/run.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package run - -import ( - "context" - "errors" - "fmt" - "os" - - sdk "github.com/conduitio/conduit-processor-sdk" - "github.com/conduitio/conduit-processor-sdk/internal/wasm" -) - -// Run is the 'entry point' for a processor. It runs a -// 'get a command, send a reply' loop through which it -// communicates with Conduit. -// -// A processor plugin needs to call this function in its main() function. -func Run(p sdk.Processor) { - for { - cmd, err := wasm.NextCommand() - if err != nil { - _, _ = fmt.Fprintf(os.Stderr, "failed retrieving next command: %v", err) - exitCode := 1 - if errors.Is(err, sdk.ErrNoMoreCommands) { - exitCode = 0 - } - os.Exit(exitCode) - } - - resp := cmd.Execute(context.Background(), p) - err = wasm.Reply(resp) - if err != nil { - _, _ = fmt.Fprintf(os.Stderr, "failed writing reply: %v\n", err) - os.Exit(1) - } - } -} diff --git a/serde/serde.go b/serde/serde.go deleted file mode 100644 index 7a57dc4..0000000 --- a/serde/serde.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright © 2023 Meroxa, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package serde - -import ( - sdk "github.com/conduitio/conduit-processor-sdk" - proto2 "github.com/conduitio/conduit-processor-sdk/proto" -) - -func MarshalCommand(resp sdk.Command) ([]byte, error) { - //nolint:wrapcheck // a wrapper function to be used in Conduit - return proto2.MarshalCommand(resp) -} - -func UnmarshalCommandResponse(bytes []byte) (sdk.CommandResponse, error) { - //nolint:wrapcheck // a wrapper function to be used in Conduit - return proto2.UnmarshalCommandResponse(bytes) -} diff --git a/wasm/command.go b/wasm/command.go new file mode 100644 index 0000000..7dfe8f3 --- /dev/null +++ b/wasm/command.go @@ -0,0 +1,70 @@ +// Copyright © 2023 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build wasm + +package wasm + +import ( + "fmt" + "unsafe" + + processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" + "google.golang.org/protobuf/proto" +) + +const defaultCommandSize = 1 + +var ( + buffer = make([]byte, defaultCommandSize) +) + +// NextCommand retrieves the next command from Conduit. +func NextCommand(cmdReq *processorv1.CommandRequest) error { + // 2 tries, 1st try is with the current buffer size, if that's not enough, + // then resize the buffer and try again + for i := 0; i < 2; i++ { + // request Conduit to write the command to the given buffer + ptr := unsafe.Pointer(&buffer[0]) + cmdSize := _nextCommand(uint32(uintptr(ptr)), uint32(cap(buffer))) + + switch { + case cmdSize >= ErrorCodeStart: // error codes + return NewErrorFromCode(cmdSize) + case cmdSize > uint32(cap(buffer)): // not enough memory + buffer = make([]byte, cmdSize) // resize buffer + continue // try again + } + + // parse the command + if err := proto.Unmarshal(buffer[:cmdSize], cmdReq); err != nil { + return fmt.Errorf("failed unmarshalling %v bytes into proto type: %w", len(buffer), err) + } + return nil + } + panic("if this is reached, then the buffer was not resized correctly and we are in an infinite loop") +} + +func Reply(resp *processorv1.CommandResponse) error { + var err error + buffer, err = proto.MarshalOptions{}.MarshalAppend(buffer[:0], resp) + if err != nil { + return fmt.Errorf("failed marshalling proto type into bytes: %w", err) + } + + ptr := unsafe.Pointer(&buffer[0]) + _reply(uint32(uintptr(ptr)), uint32(len(buffer))) + + return nil +} diff --git a/proto/errors.go b/wasm/doc.go similarity index 75% rename from proto/errors.go rename to wasm/doc.go index e9ece46..49ddb0a 100644 --- a/proto/errors.go +++ b/wasm/doc.go @@ -1,4 +1,4 @@ -// Copyright © 2023 Meroxa, Inc. +// Copyright © 2024 Meroxa, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,11 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -package proto - -import "errors" - -var ( - ErrNilCommand = errors.New("command is nil") - ErrUnknownType = errors.New("unknown type") -) +// Package wasm provides the functionality for communicating with Conduit as a +// standalone plugin. Do not use this package directly. +package wasm diff --git a/wasm/errors.go b/wasm/errors.go new file mode 100644 index 0000000..ca97c48 --- /dev/null +++ b/wasm/errors.go @@ -0,0 +1,82 @@ +// Copyright © 2024 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package wasm + +import ( + "math" +) + +const ( + // ErrorCodeStart is the smallest error code which the host (i.e. Conduit) can send. + // The imported function _nextCommand returns an uint32 value + // that is either the number of bytes actually written or an error code. + // Because of that, we're reserving a range of error codes. + ErrorCodeStart = ErrorCodeNoMoreCommands + + ErrorCodeInsufficientSize = math.MaxUint32 - iota + ErrorCodeUnknownCommandRequest + ErrorCodeUnknownCommandResponse + ErrorCodeMemoryOutOfRange + ErrorCodeNoMoreCommands +) + +var ( + ErrInsufficientSize = NewError(ErrorCodeInsufficientSize, "allocated memory size is insufficient") + ErrUnknownCommandRequest = NewError(ErrorCodeUnknownCommandRequest, "unknown command request") + ErrUnknownCommandResponse = NewError(ErrorCodeUnknownCommandResponse, "unknown command response") + ErrMemoryOutOfRange = NewError(ErrorCodeMemoryOutOfRange, "memory out of range") + ErrNoMoreCommands = NewError(ErrorCodeNoMoreCommands, "no more commands") +) + +type Error struct { + ErrCode uint32 + Message string +} + +func (e *Error) Error() string { + return e.Message +} + +func (e *Error) Is(target error) bool { + t, ok := target.(*Error) + if !ok { + return false + } + return e.ErrCode == t.ErrCode +} + +func NewError(code uint32, message string) *Error { + return &Error{ + ErrCode: code, + Message: message, + } +} + +func NewErrorFromCode(code uint32) *Error { + switch code { + case ErrorCodeInsufficientSize: + return ErrInsufficientSize + case ErrorCodeUnknownCommandRequest: + return ErrUnknownCommandRequest + case ErrorCodeUnknownCommandResponse: + return ErrUnknownCommandResponse + case ErrorCodeMemoryOutOfRange: + return ErrMemoryOutOfRange + case ErrorCodeNoMoreCommands: + return ErrNoMoreCommands + default: + return NewError(code, "unknown error code") + } +} diff --git a/internal/wasm/imports.go b/wasm/imports.go similarity index 100% rename from internal/wasm/imports.go rename to wasm/imports.go From 91dce227b739429af8a93aa5982f988d7549b74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 16:38:29 +0100 Subject: [PATCH 11/17] implement remaining methods --- processor.go | 4 +- proto/processor/v1/processor.pb.go | 67 ++++---- proto/processor/v1/processor.proto | 4 +- run.go | 235 +++++++++++++++++++++++------ wasm/command.go | 2 +- 5 files changed, 234 insertions(+), 78 deletions(-) diff --git a/processor.go b/processor.go index 1f003ac..108f4e3 100644 --- a/processor.go +++ b/processor.go @@ -130,8 +130,8 @@ func (FilterRecord) isProcessedRecord() {} // ErrorRecord is a record that failed to be processed and will be nacked. type ErrorRecord struct { - // Err is the error cause. - Err error + // Error is the error cause. + Error error } func (e ErrorRecord) isProcessedRecord() {} diff --git a/proto/processor/v1/processor.pb.go b/proto/processor/v1/processor.pb.go index 5275171..3030c74 100644 --- a/proto/processor/v1/processor.pb.go +++ b/proto/processor/v1/processor.pb.go @@ -1324,6 +1324,8 @@ type Process_ErrorRecord struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Error *ErrorResponse `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *Process_ErrorRecord) Reset() { @@ -1358,6 +1360,13 @@ func (*Process_ErrorRecord) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 4} } +func (x *Process_ErrorRecord) GetError() *ErrorResponse { + if x != nil { + return x.Error + } + return nil +} + type Teardown_Request struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1557,7 +1566,7 @@ var file_processor_v1_processor_proto_rawDesc = []byte{ 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9a, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcd, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, @@ -1582,27 +1591,30 @@ var file_processor_v1_processor_proto_rawDesc = []byte{ 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0d, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x22, 0x21, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x1a, - 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, - 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x40, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x12, 0x31, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x21, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, + 0x77, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, + 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, + 0x75, 0x69, 0x74, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, + 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1672,11 +1684,12 @@ var file_processor_v1_processor_proto_depIdxs = []int32{ 27, // 19: processor.v1.Process.ProcessedRecord.single_record:type_name -> opencdc.v1.Record 23, // 20: processor.v1.Process.ProcessedRecord.filter_record:type_name -> processor.v1.Process.FilterRecord 24, // 21: processor.v1.Process.ProcessedRecord.error_record:type_name -> processor.v1.Process.ErrorRecord - 22, // [22:22] is the sub-list for method output_type - 22, // [22:22] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name + 9, // 22: processor.v1.Process.ErrorRecord.error:type_name -> processor.v1.ErrorResponse + 23, // [23:23] is the sub-list for method output_type + 23, // [23:23] is the sub-list for method input_type + 23, // [23:23] is the sub-list for extension type_name + 23, // [23:23] is the sub-list for extension extendee + 0, // [0:23] is the sub-list for field type_name } func init() { file_processor_v1_processor_proto_init() } diff --git a/proto/processor/v1/processor.proto b/proto/processor/v1/processor.proto index 25be2e5..cc74464 100644 --- a/proto/processor/v1/processor.proto +++ b/proto/processor/v1/processor.proto @@ -132,7 +132,9 @@ message Process { } message FilterRecord {} - message ErrorRecord {} + message ErrorRecord { + ErrorResponse error = 1; + } } message Teardown { diff --git a/run.go b/run.go index c302dc1..c9d2d74 100644 --- a/run.go +++ b/run.go @@ -22,6 +22,8 @@ import ( "fmt" "os" + "github.com/conduitio/conduit-commons/opencdc" + opencdcv1 "github.com/conduitio/conduit-commons/proto/opencdc/v1" processorv1 "github.com/conduitio/conduit-processor-sdk/proto/processor/v1" "github.com/conduitio/conduit-processor-sdk/wasm" ) @@ -36,6 +38,8 @@ func Run(p Processor) { ctx := context.Background() var cmd processorv1.CommandRequest + var executor commandExecutor + for { cmd.Reset() err := wasm.NextCommand(&cmd) @@ -47,7 +51,7 @@ func Run(p Processor) { os.Exit(1) } - resp := executeCommand(ctx, p, &cmd) + resp := executor.Execute(ctx, p, &cmd) err = wasm.Reply(resp) if err != nil { _, _ = fmt.Fprintf(os.Stderr, "failed writing reply: %v\n", err) @@ -56,37 +60,33 @@ func Run(p Processor) { } } -func executeCommand(ctx context.Context, p Processor, cmdReq *processorv1.CommandRequest) *processorv1.CommandResponse { +type commandExecutor struct { + protoconv protoConverter +} + +func (e commandExecutor) Execute(ctx context.Context, p Processor, cmdReq *processorv1.CommandRequest) *processorv1.CommandResponse { var resp *processorv1.CommandResponse var err error switch req := cmdReq.GetRequest().(type) { case *processorv1.CommandRequest_Specify: - resp, err = executeCommandSpecify(ctx, p, req.Specify) + resp, err = e.executeSpecify(ctx, p, req.Specify) case *processorv1.CommandRequest_Configure: - resp, err = executeCommandConfigure(ctx, p, req.Configure) + resp, err = e.executeConfigure(ctx, p, req.Configure) case *processorv1.CommandRequest_Open: - resp, err = executeCommandOpen(ctx, p, req.Open) + resp, err = e.executeOpen(ctx, p, req.Open) case *processorv1.CommandRequest_Process: - resp, err = executeCommandProcess(ctx, p, req.Process) + resp, err = e.executeProcess(ctx, p, req.Process) case *processorv1.CommandRequest_Teardown: - resp, err = executeCommandTeardown(ctx, p, req.Teardown) + resp, err = e.executeTeardown(ctx, p, req.Teardown) default: err = wasm.ErrUnknownCommandRequest } if err != nil { - var wasmErr *wasm.Error - var code uint32 - if errors.As(err, &wasmErr) { - code = wasmErr.ErrCode - } resp = &processorv1.CommandResponse{ Response: &processorv1.CommandResponse_Error{ - Error: &processorv1.ErrorResponse{ - Code: code, - Message: err.Error(), - }, + Error: e.protoconv.errorResponse(err), }, } } @@ -94,64 +94,205 @@ func executeCommand(ctx context.Context, p Processor, cmdReq *processorv1.Comman return resp } -func executeCommandSpecify(_ context.Context, p Processor, _ *processorv1.Specify_Request) (*processorv1.CommandResponse, error) { - var spec Specification +func (e commandExecutor) executeSpecify(_ context.Context, p Processor, _ *processorv1.Specify_Request) (*processorv1.CommandResponse, error) { spec, err := p.Specification() if err != nil { return nil, err } - resp := &processorv1.CommandResponse_Specify{ - Specify: &processorv1.Specify_Response{ - Name: spec.Name, - Summary: spec.Summary, - Description: spec.Description, - Version: spec.Version, - Author: spec.Author, - Parameters: specificationParametersToProto(spec.Parameters), + return &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Specify{ + Specify: e.protoconv.specifyResponse(spec), }, + }, nil +} + +func (e commandExecutor) executeConfigure(ctx context.Context, p Processor, req *processorv1.Configure_Request) (*processorv1.CommandResponse, error) { + err := p.Configure(ctx, req.Parameters) + if err != nil { + return nil, err } - return &processorv1.CommandResponse{Response: resp}, nil + return &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Configure{ + Configure: &processorv1.Configure_Response{}, + }, + }, nil } -func specificationParametersToProto(in map[string]Parameter) map[string]*processorv1.Specify_Parameter { +func (e commandExecutor) executeOpen(ctx context.Context, p Processor, _ *processorv1.Open_Request) (*processorv1.CommandResponse, error) { + err := p.Open(ctx) + if err != nil { + return nil, err + } + return &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Open{ + Open: &processorv1.Open_Response{}, + }, + }, nil +} + +func (e commandExecutor) executeProcess(ctx context.Context, p Processor, req *processorv1.Process_Request) (*processorv1.CommandResponse, error) { + records, err := e.protoconv.records(req.Records) + if err != nil { + return nil, fmt.Errorf("failed to convert proto opencdc records: %w", err) + } + processedRecords := p.Process(ctx, records) + protoRecords, err := e.protoconv.processedRecords(processedRecords) + if err != nil { + return nil, fmt.Errorf("failed to convert processed records: %w", err) + } + + return &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Process{ + Process: &processorv1.Process_Response{ + Records: protoRecords, + }, + }, + }, nil +} + +func (e commandExecutor) executeTeardown(ctx context.Context, p Processor, _ *processorv1.Teardown_Request) (*processorv1.CommandResponse, error) { + err := p.Teardown(ctx) + if err != nil { + return nil, err + } + return &processorv1.CommandResponse{ + Response: &processorv1.CommandResponse_Teardown{ + Teardown: &processorv1.Teardown_Response{}, + }, + }, nil +} + +// protoConverter converts between the SDK and protobuf types. +type protoConverter struct{} + +func (c protoConverter) specifyResponse(in Specification) *processorv1.Specify_Response { + return &processorv1.Specify_Response{ + Name: in.Name, + Summary: in.Summary, + Description: in.Description, + Version: in.Version, + Author: in.Author, + Parameters: c.specifyParameters(in.Parameters), + } +} + +func (c protoConverter) specifyParameters(in map[string]Parameter) map[string]*processorv1.Specify_Parameter { out := make(map[string]*processorv1.Specify_Parameter, len(in)) for name, param := range in { - out[name] = &processorv1.Specify_Parameter{ - Default: param.Default, - Description: param.Description, - Type: processorv1.Specify_Parameter_Type(param.Type), - Validations: specificationValidationsToProto(param.Validations), - } + out[name] = c.specifyParameter(param) } return out } -func specificationValidationsToProto(in []Validation) []*processorv1.Specify_Parameter_Validation { +func (c protoConverter) specifyParameter(in Parameter) *processorv1.Specify_Parameter { + return &processorv1.Specify_Parameter{ + Default: in.Default, + Description: in.Description, + Type: processorv1.Specify_Parameter_Type(in.Type), + Validations: c.specifyParameterValidations(in.Validations), + } +} + +func (c protoConverter) specifyParameterValidations(in []Validation) []*processorv1.Specify_Parameter_Validation { if in == nil { return nil } out := make([]*processorv1.Specify_Parameter_Validation, len(in)) for i, v := range in { - out[i] = &processorv1.Specify_Parameter_Validation{ - Type: processorv1.Specify_Parameter_Validation_Type(v.Type), - Value: v.Value, - } + out[i] = c.specifyParameterValidation(v) } return out } -func executeCommandConfigure(ctx context.Context, p Processor, req *processorv1.Configure_Request) (*processorv1.CommandResponse, error) { - panic("unimplemented") +func (c protoConverter) specifyParameterValidation(in Validation) *processorv1.Specify_Parameter_Validation { + return &processorv1.Specify_Parameter_Validation{ + Type: processorv1.Specify_Parameter_Validation_Type(in.Type), + Value: in.Value, + } +} + +func (c protoConverter) records(in []*opencdcv1.Record) ([]opencdc.Record, error) { + if in == nil { + return nil, nil + } + out := make([]opencdc.Record, len(in)) + for i, v := range in { + err := out[i].FromProto(v) + if err != nil { + return nil, err + } + } + return out, nil +} + +func (c protoConverter) processedRecords(in []ProcessedRecord) ([]*processorv1.Process_ProcessedRecord, error) { + if in == nil { + return nil, nil + } + + var err error + out := make([]*processorv1.Process_ProcessedRecord, len(in)) + for i, v := range in { + out[i], err = c.processedRecord(v) + if err != nil { + return nil, err + } + } + return out, nil +} + +func (c protoConverter) processedRecord(in ProcessedRecord) (*processorv1.Process_ProcessedRecord, error) { + switch v := in.(type) { + case SingleRecord: + return c.singleRecord(v) + case FilterRecord: + return c.filterRecord(v) + case ErrorRecord: + return c.errorRecord(v) + default: + panic(fmt.Errorf("unknown processed record type: %T", in)) + } +} + +func (c protoConverter) singleRecord(in SingleRecord) (*processorv1.Process_ProcessedRecord, error) { + opencdcRecord := &opencdcv1.Record{} + err := opencdc.Record(in).ToProto(opencdcRecord) + if err != nil { + return nil, err + } + return &processorv1.Process_ProcessedRecord{ + Record: &processorv1.Process_ProcessedRecord_SingleRecord{ + SingleRecord: opencdcRecord, + }, + }, nil } -func executeCommandOpen(ctx context.Context, p Processor, req *processorv1.Open_Request) (*processorv1.CommandResponse, error) { - panic("unimplemented") +func (c protoConverter) filterRecord(_ FilterRecord) (*processorv1.Process_ProcessedRecord, error) { + return &processorv1.Process_ProcessedRecord{ + Record: &processorv1.Process_ProcessedRecord_FilterRecord{ + FilterRecord: &processorv1.Process_FilterRecord{}, + }, + }, nil } -func executeCommandProcess(ctx context.Context, p Processor, req *processorv1.Process_Request) (*processorv1.CommandResponse, error) { - panic("unimplemented") +func (c protoConverter) errorRecord(in ErrorRecord) (*processorv1.Process_ProcessedRecord, error) { + return &processorv1.Process_ProcessedRecord{ + Record: &processorv1.Process_ProcessedRecord_ErrorRecord{ + ErrorRecord: &processorv1.Process_ErrorRecord{ + Error: c.errorResponse(in.Error), + }, + }, + }, nil } -func executeCommandTeardown(ctx context.Context, p Processor, req *processorv1.Teardown_Request) (*processorv1.CommandResponse, error) { - panic("unimplemented") +func (c protoConverter) errorResponse(err error) *processorv1.ErrorResponse { + var wasmErr *wasm.Error + var code uint32 + if errors.As(err, &wasmErr) { + code = wasmErr.ErrCode + } + return &processorv1.ErrorResponse{ + Code: code, + Message: err.Error(), + } } diff --git a/wasm/command.go b/wasm/command.go index 7dfe8f3..25bcc5b 100644 --- a/wasm/command.go +++ b/wasm/command.go @@ -24,7 +24,7 @@ import ( "google.golang.org/protobuf/proto" ) -const defaultCommandSize = 1 +const defaultCommandSize = 1024 // 1kB var ( buffer = make([]byte, defaultCommandSize) From 85a1ccb5d98e8ed3fc699a2bff12b7a26c81ac42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 16:59:19 +0100 Subject: [PATCH 12/17] add unimplemented processor for forward compatibility --- errors.go | 23 +++++++++++++++++++++ processor.go | 2 ++ run.go | 18 +++++++++++++++++ unimplemented.go | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 errors.go create mode 100644 unimplemented.go diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..49260f0 --- /dev/null +++ b/errors.go @@ -0,0 +1,23 @@ +// Copyright © 2024 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sdk + +import "errors" + +var ( + // ErrUnimplemented is returned in functions of plugins that don't implement + // a certain method. + ErrUnimplemented = errors.New("the processor plugin does not implement this action, please check the source code of the processor and make sure all required processor methods are implemented") +) diff --git a/processor.go b/processor.go index 108f4e3..2bb4780 100644 --- a/processor.go +++ b/processor.go @@ -52,6 +52,8 @@ type Processor interface { // there will be no more calls to any other function. After Teardown returns, // the processor will be discarded. Teardown(context.Context) error + + mustEmbedUnimplementedProcessor() } // Specification is returned by a processor when Specify is called. diff --git a/run.go b/run.go index c9d2d74..075f1ea 100644 --- a/run.go +++ b/run.go @@ -165,6 +165,24 @@ func (e commandExecutor) executeTeardown(ctx context.Context, p Processor, _ *pr // protoConverter converts between the SDK and protobuf types. type protoConverter struct{} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + var cTypes [1]struct{} + _ = cTypes[int(ValidationTypeRequired)-int(processorv1.Specify_Parameter_Validation_TYPE_REQUIRED)] + _ = cTypes[int(ValidationTypeRegex)-int(processorv1.Specify_Parameter_Validation_TYPE_REGEX)] + _ = cTypes[int(ValidationTypeInclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_INCLUSION)] + _ = cTypes[int(ValidationTypeExclusion)-int(processorv1.Specify_Parameter_Validation_TYPE_EXCLUSION)] + _ = cTypes[int(ValidationTypeLessThan)-int(processorv1.Specify_Parameter_Validation_TYPE_LESS_THAN)] + _ = cTypes[int(ValidationTypeGreaterThan)-int(processorv1.Specify_Parameter_Validation_TYPE_GREATER_THAN)] + + _ = cTypes[int(ParameterTypeInt)-int(processorv1.Specify_Parameter_TYPE_INT)] + _ = cTypes[int(ParameterTypeFloat)-int(processorv1.Specify_Parameter_TYPE_FLOAT)] + _ = cTypes[int(ParameterTypeBool)-int(processorv1.Specify_Parameter_TYPE_BOOL)] + _ = cTypes[int(ParameterTypeString)-int(processorv1.Specify_Parameter_TYPE_STRING)] + _ = cTypes[int(ParameterTypeDuration)-int(processorv1.Specify_Parameter_TYPE_DURATION)] + _ = cTypes[int(ParameterTypeFile)-int(processorv1.Specify_Parameter_TYPE_FILE)] +} + func (c protoConverter) specifyResponse(in Specification) *processorv1.Specify_Response { return &processorv1.Specify_Response{ Name: in.Name, diff --git a/unimplemented.go b/unimplemented.go new file mode 100644 index 0000000..f134e12 --- /dev/null +++ b/unimplemented.go @@ -0,0 +1,52 @@ +// Copyright © 2024 Meroxa, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package sdk + +import ( + "context" + "fmt" + + "github.com/conduitio/conduit-commons/opencdc" +) + +// UnimplementedProcessor should be embedded to have forward compatible implementations. +type UnimplementedProcessor struct{} + +// Specification needs to be overridden in the actual implementation. +func (UnimplementedProcessor) Specification() (Specification, error) { + return Specification{}, fmt.Errorf("action \"Specification\": %w", ErrUnimplemented) +} + +// Configure needs to be overridden in the actual implementation. +func (UnimplementedProcessor) Configure(context.Context, map[string]string) error { + return fmt.Errorf("action \"Configure\": %w", ErrUnimplemented) +} + +// Open needs to be overridden in the actual implementation. +func (UnimplementedProcessor) Open(context.Context) error { + return fmt.Errorf("action \"Open\": %w", ErrUnimplemented) +} + +// Process needs to be overridden in the actual implementation. +func (UnimplementedProcessor) Process(context.Context, []opencdc.Record) []ProcessedRecord { + return nil +} + +// Teardown needs to be overridden in the actual implementation. +func (UnimplementedProcessor) Teardown(context.Context) error { + return fmt.Errorf("action \"Teardown\": %w", ErrUnimplemented) +} + +func (UnimplementedProcessor) mustEmbedUnimplementedProcessor() {} From 555fdc653715ef1c9f00801c94827efa9feea8df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 17:02:09 +0100 Subject: [PATCH 13/17] go mod tidy --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 59c4b47..28734be 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/bufbuild/buf v1.28.1 github.com/conduitio/conduit-commons v0.0.0-20240103200651-5a5746611a8e github.com/golangci/golangci-lint v1.55.2 - github.com/matryer/is v1.4.1 go.uber.org/mock v0.4.0 google.golang.org/protobuf v1.32.0 mvdan.cc/gofumpt v0.5.0 From c3388897161a923495f08b04dbda928663b51f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 17:14:59 +0100 Subject: [PATCH 14/17] fix linter error --- errors.go | 8 +++----- run.go | 6 +++++- wasm/errors.go | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/errors.go b/errors.go index 49260f0..e3ffaf2 100644 --- a/errors.go +++ b/errors.go @@ -16,8 +16,6 @@ package sdk import "errors" -var ( - // ErrUnimplemented is returned in functions of plugins that don't implement - // a certain method. - ErrUnimplemented = errors.New("the processor plugin does not implement this action, please check the source code of the processor and make sure all required processor methods are implemented") -) +// ErrUnimplemented is returned in functions of plugins that don't implement +// a certain method. +var ErrUnimplemented = errors.New("the processor plugin does not implement this action, please check the source code of the processor and make sure all required processor methods are implemented") diff --git a/run.go b/run.go index 075f1ea..93a4b95 100644 --- a/run.go +++ b/run.go @@ -60,10 +60,13 @@ func Run(p Processor) { } } +// commandExecutor executes commands received from Conduit. type commandExecutor struct { protoconv protoConverter } +// Execute executes the given command request. It returns a command response +// that will be sent back to Conduit. func (e commandExecutor) Execute(ctx context.Context, p Processor, cmdReq *processorv1.CommandRequest) *processorv1.CommandResponse { var resp *processorv1.CommandResponse var err error @@ -167,6 +170,7 @@ type protoConverter struct{} func _() { // An "invalid array index" compiler error signifies that the constant values have changed. + // This is to ensure that the proto enums are in sync with the SDK enums. var cTypes [1]struct{} _ = cTypes[int(ValidationTypeRequired)-int(processorv1.Specify_Parameter_Validation_TYPE_REQUIRED)] _ = cTypes[int(ValidationTypeRegex)-int(processorv1.Specify_Parameter_Validation_TYPE_REGEX)] @@ -268,7 +272,7 @@ func (c protoConverter) processedRecord(in ProcessedRecord) (*processorv1.Proces case ErrorRecord: return c.errorRecord(v) default: - panic(fmt.Errorf("unknown processed record type: %T", in)) + return nil, fmt.Errorf("unknown processed record type: %T", in) } } diff --git a/wasm/errors.go b/wasm/errors.go index ca97c48..1a3aa07 100644 --- a/wasm/errors.go +++ b/wasm/errors.go @@ -40,6 +40,7 @@ var ( ErrNoMoreCommands = NewError(ErrorCodeNoMoreCommands, "no more commands") ) +// Error is an error sent to or received from the host (i.e. Conduit). type Error struct { ErrCode uint32 Message string From 807eb3646db67d2a5c9041f2d3af96237d389340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 17:47:13 +0100 Subject: [PATCH 15/17] add buf.md --- proto/buf.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 proto/buf.md diff --git a/proto/buf.md b/proto/buf.md new file mode 100644 index 0000000..76f15af --- /dev/null +++ b/proto/buf.md @@ -0,0 +1,4 @@ +# Conduit Processor SDK + +This repository contains the proto definitions for the Conduit Processor SDK. +For more info see the [source repository](https://github.com/ConduitIO/conduit-processor-sdk). From 7630a6090a135d48dadd624dcad70ad78ed4ac69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 17:53:33 +0100 Subject: [PATCH 16/17] rename ErrorResponse to Error, more docs --- proto/processor/v1/processor.pb.go | 315 ++++++++++++++--------------- proto/processor/v1/processor.proto | 6 +- run.go | 20 +- 3 files changed, 177 insertions(+), 164 deletions(-) diff --git a/proto/processor/v1/processor.pb.go b/proto/processor/v1/processor.pb.go index 3030c74..77ec0d7 100644 --- a/proto/processor/v1/processor.pb.go +++ b/proto/processor/v1/processor.pb.go @@ -334,7 +334,7 @@ func (m *CommandResponse) GetResponse() isCommandResponse_Response { return nil } -func (x *CommandResponse) GetError() *ErrorResponse { +func (x *CommandResponse) GetError() *Error { if x, ok := x.GetResponse().(*CommandResponse_Error); ok { return x.Error } @@ -381,7 +381,7 @@ type isCommandResponse_Response interface { } type CommandResponse_Error struct { - Error *ErrorResponse `protobuf:"bytes,1,opt,name=error,proto3,oneof"` + Error *Error `protobuf:"bytes,1,opt,name=error,proto3,oneof"` } type CommandResponse_Specify struct { @@ -606,7 +606,7 @@ func (*Teardown) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{6} } -type ErrorResponse struct { +type Error struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -615,8 +615,8 @@ type ErrorResponse struct { Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` } -func (x *ErrorResponse) Reset() { - *x = ErrorResponse{} +func (x *Error) Reset() { + *x = Error{} if protoimpl.UnsafeEnabled { mi := &file_processor_v1_processor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -624,13 +624,13 @@ func (x *ErrorResponse) Reset() { } } -func (x *ErrorResponse) String() string { +func (x *Error) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ErrorResponse) ProtoMessage() {} +func (*Error) ProtoMessage() {} -func (x *ErrorResponse) ProtoReflect() protoreflect.Message { +func (x *Error) ProtoReflect() protoreflect.Message { mi := &file_processor_v1_processor_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -642,19 +642,19 @@ func (x *ErrorResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead. -func (*ErrorResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{7} } -func (x *ErrorResponse) GetCode() uint32 { +func (x *Error) GetCode() uint32 { if x != nil { return x.Code } return 0 } -func (x *ErrorResponse) GetMessage() string { +func (x *Error) GetMessage() string { if x != nil { return x.Message } @@ -1325,7 +1325,7 @@ type Process_ErrorRecord struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Error *ErrorResponse `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` } func (x *Process_ErrorRecord) Reset() { @@ -1360,7 +1360,7 @@ func (*Process_ErrorRecord) Descriptor() ([]byte, []int) { return file_processor_v1_processor_proto_rawDescGZIP(), []int{5, 4} } -func (x *Process_ErrorRecord) GetError() *ErrorResponse { +func (x *Process_ErrorRecord) GetError() *Error { if x != nil { return x.Error } @@ -1470,151 +1470,150 @@ var file_processor_v1_processor_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, - 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xfe, 0x02, 0x0a, 0x0f, + 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xf6, 0x02, 0x0a, 0x0f, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x33, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, - 0x12, 0x40, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x4f, 0x70, 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, - 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3a, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, - 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x07, 0x0a, - 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0xbc, 0x02, 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, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, - 0x72, 0x73, 0x1a, 0x5e, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0xcc, 0x04, 0x0a, 0x09, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, - 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, - 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, - 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, - 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfc, 0x01, 0x0a, 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, - 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, - 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, - 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, - 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, - 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, - 0x4e, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x45, - 0x58, 0x10, 0x06, 0x22, 0x7c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, - 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02, - 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x03, - 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, - 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, - 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, - 0x06, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x1a, - 0x99, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0a, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x0a, 0x0a, 0x08, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, - 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xcd, 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, - 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, - 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, - 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0xe9, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x39, 0x0a, 0x0d, - 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, - 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x49, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x72, 0x6f, 0x72, 0x48, 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3a, 0x0a, 0x07, + 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, + 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x12, 0x40, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x75, 0x72, 0x65, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x09, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x6f, 0x70, + 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6f, 0x70, 0x65, 0x6e, 0x12, 0x3a, 0x0a, + 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x12, 0x46, 0x0a, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, - 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, 0x0a, 0x0c, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, - 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x40, 0x0a, 0x0b, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x12, 0x31, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, + 0x52, 0x07, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, 0x0a, 0x08, 0x74, 0x65, 0x61, + 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x72, 0x64, + 0x6f, 0x77, 0x6e, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x08, + 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa2, 0x07, 0x0a, 0x07, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, + 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0xbc, 0x02, 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, 0x12, 0x18, 0x0a, 0x07, + 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x4e, 0x0a, 0x0a, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x1a, 0x5e, 0x0a, 0x0f, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, + 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xcc, 0x04, 0x0a, 0x09, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4c, + 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0b, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xfc, 0x01, 0x0a, + 0x0a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, + 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, + 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x02, 0x12, + 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, + 0x4e, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x43, 0x4c, + 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x45, 0x58, 0x43, 0x4c, 0x55, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x47, 0x45, 0x58, 0x10, 0x06, 0x22, 0x7c, 0x0a, 0x04, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x46, 0x49, 0x4c, 0x45, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, + 0x55, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x22, 0xb3, 0x01, 0x0a, 0x09, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x1a, 0x99, 0x01, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, + 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, + 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, + 0x74, 0x65, 0x72, 0x73, 0x1a, 0x3d, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, + 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1d, 0x0a, 0x04, 0x4f, 0x70, 0x65, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x0a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc5, + 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x37, 0x0a, 0x07, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x63, 0x64, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x73, 0x1a, 0x4b, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x3f, 0x0a, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, + 0x1a, 0xe9, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x52, 0x65, + 0x63, 0x6f, 0x72, 0x64, 0x12, 0x39, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x72, + 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x70, + 0x65, 0x6e, 0x63, 0x64, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, + 0x00, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x49, 0x0a, 0x0d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x46, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x66, 0x69, + 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x46, 0x0a, 0x0c, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, + 0x72, 0x64, 0x42, 0x08, 0x0a, 0x06, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x0e, 0x0a, 0x0c, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x1a, 0x38, 0x0a, 0x0b, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x29, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x21, 0x0a, 0x08, 0x54, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x1a, 0x09, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0a, 0x0a, - 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, - 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, - 0x75, 0x69, 0x74, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, - 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, - 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, - 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, - 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, - 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x05, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x69, 0x6f, 0x2f, 0x63, 0x6f, + 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2d, + 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, + 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, + 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -1641,7 +1640,7 @@ var file_processor_v1_processor_proto_goTypes = []interface{}{ (*Open)(nil), // 6: processor.v1.Open (*Process)(nil), // 7: processor.v1.Process (*Teardown)(nil), // 8: processor.v1.Teardown - (*ErrorResponse)(nil), // 9: processor.v1.ErrorResponse + (*Error)(nil), // 9: processor.v1.Error (*Specify_Request)(nil), // 10: processor.v1.Specify.Request (*Specify_Response)(nil), // 11: processor.v1.Specify.Response (*Specify_Parameter)(nil), // 12: processor.v1.Specify.Parameter @@ -1667,7 +1666,7 @@ var file_processor_v1_processor_proto_depIdxs = []int32{ 18, // 2: processor.v1.CommandRequest.open:type_name -> processor.v1.Open.Request 20, // 3: processor.v1.CommandRequest.process:type_name -> processor.v1.Process.Request 25, // 4: processor.v1.CommandRequest.teardown:type_name -> processor.v1.Teardown.Request - 9, // 5: processor.v1.CommandResponse.error:type_name -> processor.v1.ErrorResponse + 9, // 5: processor.v1.CommandResponse.error:type_name -> processor.v1.Error 11, // 6: processor.v1.CommandResponse.specify:type_name -> processor.v1.Specify.Response 16, // 7: processor.v1.CommandResponse.configure:type_name -> processor.v1.Configure.Response 19, // 8: processor.v1.CommandResponse.open:type_name -> processor.v1.Open.Response @@ -1684,7 +1683,7 @@ var file_processor_v1_processor_proto_depIdxs = []int32{ 27, // 19: processor.v1.Process.ProcessedRecord.single_record:type_name -> opencdc.v1.Record 23, // 20: processor.v1.Process.ProcessedRecord.filter_record:type_name -> processor.v1.Process.FilterRecord 24, // 21: processor.v1.Process.ProcessedRecord.error_record:type_name -> processor.v1.Process.ErrorRecord - 9, // 22: processor.v1.Process.ErrorRecord.error:type_name -> processor.v1.ErrorResponse + 9, // 22: processor.v1.Process.ErrorRecord.error:type_name -> processor.v1.Error 23, // [23:23] is the sub-list for method output_type 23, // [23:23] is the sub-list for method input_type 23, // [23:23] is the sub-list for extension type_name @@ -1783,7 +1782,7 @@ func file_processor_v1_processor_proto_init() { } } file_processor_v1_processor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ErrorResponse); i { + switch v := v.(*Error); i { case 0: return &v.state case 1: diff --git a/proto/processor/v1/processor.proto b/proto/processor/v1/processor.proto index cc74464..a254fef 100644 --- a/proto/processor/v1/processor.proto +++ b/proto/processor/v1/processor.proto @@ -15,7 +15,7 @@ message CommandRequest { } message CommandResponse { oneof response { - ErrorResponse error = 1; + Error error = 1; Specify.Response specify = 2; Configure.Response configure = 3; @@ -133,7 +133,7 @@ message Process { message FilterRecord {} message ErrorRecord { - ErrorResponse error = 1; + Error error = 1; } } @@ -142,7 +142,7 @@ message Teardown { message Response {} } -message ErrorResponse { +message Error { uint32 code = 1; string message = 2; } \ No newline at end of file diff --git a/run.go b/run.go index 93a4b95..7aed1b3 100644 --- a/run.go +++ b/run.go @@ -33,7 +33,21 @@ import ( // occurs, it will be printed to stderr and the process will exit with a non-zero // exit code. Otherwise, it will exit with a zero exit code. // -// A processor plugin needs to call this function in its main function. +// A processor plugin needs to call this function in its main function. The +// entrypoint file should look like this: +// +// //go:build wasm +// +// package main +// +// import ( +// sdk "github.com/conduitio/conduit-processor-sdk" +// ) +// +// func main() { +// processor := NewMyProcessor() +// sdk.Run(processor) +// } func Run(p Processor) { ctx := context.Background() var cmd processorv1.CommandRequest @@ -307,13 +321,13 @@ func (c protoConverter) errorRecord(in ErrorRecord) (*processorv1.Process_Proces }, nil } -func (c protoConverter) errorResponse(err error) *processorv1.ErrorResponse { +func (c protoConverter) errorResponse(err error) *processorv1.Error { var wasmErr *wasm.Error var code uint32 if errors.As(err, &wasmErr) { code = wasmErr.ErrCode } - return &processorv1.ErrorResponse{ + return &processorv1.Error{ Code: code, Message: err.Error(), } From a558e599a735e70425a5e00f5be7adb1356abb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lovro=20Ma=C5=BEgon?= Date: Thu, 11 Jan 2024 17:57:55 +0100 Subject: [PATCH 17/17] change proto go package prefix --- proto/buf.gen.yaml | 2 +- proto/processor/v1/processor.pb.go | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index b212081..10cde0a 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -2,7 +2,7 @@ version: v1 managed: enabled: true go_package_prefix: - default: "github.com/conduitio/conduit-processor-sdk/internal/proto" + default: "github.com/conduitio/conduit-processor-sdk/proto" except: - buf.build/conduitio/conduit-commons plugins: diff --git a/proto/processor/v1/processor.pb.go b/proto/processor/v1/processor.pb.go index 77ec0d7..8c85bba 100644 --- a/proto/processor/v1/processor.pb.go +++ b/proto/processor/v1/processor.pb.go @@ -1600,20 +1600,19 @@ var file_processor_v1_processor_proto_rawDesc = []byte{ 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0xc7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x42, 0xbe, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x52, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x64, 0x75, 0x69, 0x74, 0x2d, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2d, - 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, - 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, - 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0d, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x73, 0x64, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x50, 0x58, 0x58, 0xaa, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, + 0x73, 0x73, 0x6f, 0x72, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x6f, 0x72, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x6f, 0x72, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var (