diff --git a/api.go b/api.go index aded45e..dd47c52 100644 --- a/api.go +++ b/api.go @@ -1,21 +1,22 @@ package sdk import ( - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" "context" - "fmt" - "golang.org/x/exp/slog" "io" "time" + + "golang.org/x/exp/slog" + + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) type Category = rpcv1.Category const ( - CategoryTool Category = rpcv1.Category_CategoryTool - CategoryTask Category = rpcv1.Category_CategoryTask - CategoryBuild Category = rpcv1.Category_CategoryBuild - CategoryPackage Category = rpcv1.Category_CategoryPackage + CategoryTool = rpcv1.Category_CategoryTool + CategoryTask = rpcv1.Category_CategoryTask + CategoryBuild = rpcv1.Category_CategoryBuild + CategoryPackage = rpcv1.Category_CategoryPackage ) type StateMetadata struct { @@ -35,6 +36,13 @@ type ExecutionContext interface { SetState(ctx context.Context, key string, value []byte) error } +type TaskSpec[T Module] struct { + Module T + ModuleName string + Container *rpcv1.ContainerSpec + OutputDir string +} + type Module interface { Execute(ctx ExecutionContext) error Category() Category diff --git a/api/rpc/v1/executor.proto b/api/rpc/v1/executor.proto index eda2b1e..04be350 100644 --- a/api/rpc/v1/executor.proto +++ b/api/rpc/v1/executor.proto @@ -18,11 +18,6 @@ message Buildr { string out_dir = 4; } -message ModuleReference { - Category module_category = 1; - string module_type = 2; -} - message TaskReference { string id = 1; string name = 2; @@ -32,7 +27,7 @@ message TaskReference { message StartTaskRequest { TaskReference reference = 1; Buildr buildr = 2; - bytes raw_task = 3; + ModuleSpec spec = 3; } message TaskResult { diff --git a/api/rpc/v1/spec.proto b/api/rpc/v1/spec.proto index df8c7e1..edfd2ad 100644 --- a/api/rpc/v1/spec.proto +++ b/api/rpc/v1/spec.proto @@ -3,67 +3,98 @@ syntax = "proto3"; package buildr.rpc.v1; enum Category { - CategoryUnknown = 0; - CategoryTool = 1; - CategoryTask = 2; - CategoryBuild = 3; - CategoryPackage = 4; + CategoryUnknown = 0; + CategoryTool = 1; + CategoryTask = 2; + CategoryBuild = 3; + CategoryPackage = 4; } -message ModuleDescription { - message DescriptionValue { - string key = 1; - oneof value { - string string_value = 2; - int64 int_value = 3; - double double_value = 4; - bool bool_value = 5; - DescriptionValue nested_value = 6; - } +message ModuleReference { + Category module_category = 1; + string module_type = 2; +} + +message ModuleSpec { + + enum ValueKind { + ValueKindUnknown = 0; + ValueKindAttribute = 1; + ValueKindLabel = 2; + ValueKindBlock = 4; + } + + enum ValueType { + ValueTypeUnknown = 0; + ValueTypeSingle = 1; + ValueTypeObject = 2; + ValueTypeMap = 3; + ValueTypeStringSlice = 4; + ValueTypeIntSlice = 5; + ValueTypeDoubleSlice = 6; + ValueTypeBoolSlice = 7; + } + + message Value { + ValueType type = 1; + ValueKind kind = 2; + + map complex_value = 10; + + oneof single_value { + string string_value = 11; + int64 int_value = 12; + double double_value = 13; + bool bool_value = 14; } - Category category = 1; - string type = 2; - repeated DescriptionValue description_values = 3; + repeated string string_values = 21; + repeated int64 int_values = 22; + repeated double double_values = 23; + repeated bool bool_values = 24; + } + + Category category = 1; + string type = 2; + map values = 3; } message ContainerCapabilities { - repeated string add = 1; - repeated string drop = 2; + repeated string add = 1; + repeated string drop = 2; } message ContainerBindMount { - string target = 1; - string source = 2; - bool read_only = 3; + string target = 1; + string source = 2; + bool read_only = 3; } message ContainerTmpfsMount { - string target = 1; - int64 size = 2; - bool read_only = 3; + string target = 1; + int64 size = 2; + bool read_only = 3; } message ContainerVolumeMount { - string target = 1; - string name = 2; - bool read_only = 3; - bool no_copy = 4; + string target = 1; + string name = 2; + bool read_only = 3; + bool no_copy = 4; } message ContainerSpec { - string image = 1; - string user = 2; - bool privileged = 3; - ContainerCapabilities capabilities = 4; - repeated ContainerVolumeMount volume_mounts = 5; - repeated ContainerTmpfsMount tmpfs_mounts = 6; - repeated ContainerBindMount bind_mounts = 7; + string image = 1; + string user = 2; + bool privileged = 3; + ContainerCapabilities capabilities = 4; + repeated ContainerVolumeMount volume_mounts = 5; + repeated ContainerTmpfsMount tmpfs_mounts = 6; + repeated ContainerBindMount bind_mounts = 7; } message TaskSpec { - string module_name = 1; - ModuleDescription module_description = 2; - map input_mapping = 3; - ContainerSpec container = 4; - string output_dir = 5; -} \ No newline at end of file + string module_name = 1; + ModuleSpec module_spec = 2; + ContainerSpec container = 3; + string output_dir = 4; +} diff --git a/api/rpc/v1/wasi.proto b/api/rpc/v1/wasi.proto index 4b9188e..c16625d 100644 --- a/api/rpc/v1/wasi.proto +++ b/api/rpc/v1/wasi.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package buildr.rpc.v1; +import "rpc/v1/spec.proto"; + message ProcessStartRequest { string command = 1; repeated string args = 2; @@ -23,4 +25,20 @@ message LookupPathRequest { message LookupPathResponse { string path = 1; string error = 2; +} + +message HelpRequest { + ModuleReference module_reference = 1; +} + +message TaskExample { + string name = 1; + string description = 2; + TaskSpec task_spec = 3; +} + +message HelpResponse { + string name = 1; + string description = 2; + repeated TaskExample examples = 3; } \ No newline at end of file diff --git a/entrypoint.go b/entrypoint.go index bb67d10..e9c8873 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -2,11 +2,12 @@ package sdk import ( "context" - "encoding/json" + "log/slog" _ "github.com/tetratelabs/tinymem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" + "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) @@ -22,7 +23,7 @@ func Inventory() uint64 { for _, t := range defaultRegistry.List() { inventory.Modules = append(inventory.Modules, &rpcv1.ModuleReference{ - ModuleCategory: t.Category.String(), + ModuleCategory: t.Category, ModuleType: t.Type, }) } @@ -45,11 +46,62 @@ func Run(specPtr, specSize uint32) { executor := NewExecutor(startTask.Buildr.Repo.Root, startTask.Buildr.OutDir, startTask.Buildr.BinDir) reference := startTask.GetReference().GetModule() - module := defaultRegistry.Get(Category(reference.GetModuleCategory()), reference.GetModuleType()) + module := defaultRegistry.Get(reference.GetModuleCategory(), reference.GetModuleType()) - if err := json.Unmarshal(startTask.RawTask, module); err != nil { + if err := protocol.Unmarshal(startTask.GetSpec(), module); err != nil { + executor.logger.Error("Failed to unmarshal spec", slog.String("error", err.Error())) panic(err) } executor.Run(context.Background(), module) } + +//export help +func HelpFor(pecPtr, specSize uint32) uint64 { + var helpRequest rpcv1.HelpRequest + + if err := helpRequest.UnmarshalVT(mem.DataFromPtr(pecPtr, specSize)); err != nil { + panic(err) + } + + module := defaultRegistry.Get(helpRequest.ModuleReference.ModuleCategory, helpRequest.ModuleReference.ModuleType) + if module == nil { + return 0 + } + + helper, ok := module.(Helper) + if !ok { + return 0 + } + + modHelp := helper.Help() + var helpResponse = &rpcv1.HelpResponse{ + Name: modHelp.Name, + Description: modHelp.Description, + Examples: make([]*rpcv1.TaskExample, 0, len(modHelp.Examples)), + } + + for _, e := range modHelp.Examples { + modSpec, err := protocol.Marshal(e.Spec.Module) + if err != nil { + panic(err) + } + helpResponse.Examples = append(helpResponse.Examples, &rpcv1.TaskExample{ + Name: e.Name, + Description: e.Description, + TaskSpec: &rpcv1.TaskSpec{ + ModuleName: e.Spec.ModuleName, + Container: e.Spec.Container, + OutputDir: e.Spec.OutputDir, + ModuleSpec: modSpec, + }, + }) + } + + data, err := helpResponse.MarshalVT() + if err != nil { + panic(err) + } + + return mem.UnifyPtrSize(mem.DataToUnmanagedPtr(data)) +} diff --git a/examples/hello_world_go/go.mod b/examples/hello_world_go/go.mod index e7f94b8..a519c2c 100644 --- a/examples/hello_world_go/go.mod +++ b/examples/hello_world_go/go.mod @@ -3,66 +3,19 @@ module hello_world go 1.20 require ( - code.icb4dc0.de/buildr/buildr v0.0.0-00010101000000-000000000000 - code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-20230629182727-3bf4797b6abd + code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-20230701111906-1f0c58b1c8a4 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 -) - -replace ( - code.icb4dc0.de/buildr/buildr => ../../../buildr - code.icb4dc0.de/buildr/wasi-module-sdk-go => ../../ + golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 ) require ( - ariga.io/atlas v0.12.0 // indirect - entgo.io/ent v0.12.3 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230528122434-6f98819771a1 // indirect - github.com/agext/levenshtein v1.2.3 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect - github.com/cloudflare/circl v1.3.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/docker/docker v24.0.2+incompatible // indirect - github.com/dustin/go-humanize v1.0.1 // indirect - github.com/go-openapi/inflect v0.19.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/go-github/v53 v53.0.0 // indirect - github.com/google/go-querystring v1.1.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/hashicorp/hcl/v2 v2.17.0 // indirect - github.com/jinzhu/copier v0.3.5 // indirect - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.16.5 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/rogpeppe/go-internal v1.10.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/tetratelabs/tinymem v0.1.0 // indirect - github.com/tetratelabs/wazero v1.2.0 // indirect - github.com/zclconf/go-cty v1.13.2 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect - golang.org/x/tools v0.9.3 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect - google.golang.org/protobuf v1.30.0 // indirect - gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - lukechampine.com/uint128 v1.3.0 // indirect - modernc.org/cc/v3 v3.41.0 // indirect - modernc.org/ccgo/v3 v3.16.14 // indirect - modernc.org/libc v1.24.1 // indirect - modernc.org/mathutil v1.5.0 // indirect - modernc.org/memory v1.6.0 // indirect - modernc.org/opt v0.1.3 // indirect - modernc.org/sqlite v1.23.1 // indirect - modernc.org/strutil v1.1.3 // indirect - modernc.org/token v1.1.0 // indirect ) diff --git a/examples/hello_world_go/go.sum b/examples/hello_world_go/go.sum index 209fef6..be07caa 100644 --- a/examples/hello_world_go/go.sum +++ b/examples/hello_world_go/go.sum @@ -1,65 +1,17 @@ -ariga.io/atlas v0.12.0 h1:jDfjxT3ppKhzqLS26lZv9ni7p9TVNrhy7SQquaF7bPs= -ariga.io/atlas v0.12.0/go.mod h1:+TR129FJZ5Lvzms6dvCeGWh1yR6hMvmXBhug4hrNIGk= -code.icb4dc0.de/prskr/go-pwgen v0.0.0-20230427131724-8ef26fd9749e h1:N+3hdfeHRf/ndLjiZoet6h+9eZ2Zr5O/Ia5G7b3oQXU= -entgo.io/ent v0.12.3 h1:N5lO2EOrHpCH5HYfiMOCHYbo+oh5M8GjT0/cx5x6xkk= -entgo.io/ent v0.12.3/go.mod h1:AigGGx+tbrBBYHAzGOg8ND661E5cxx1Uiu5o/otJ6Yg= -github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= -github.com/ProtonMail/go-crypto v0.0.0-20230528122434-6f98819771a1 h1:JMDGhoQvXNTqH6Y3MC0IUw6tcZvaUdujNqzK2HYWZc8= -github.com/ProtonMail/go-crypto v0.0.0-20230528122434-6f98819771a1/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= -github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= -github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= +code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-20230701111906-1f0c58b1c8a4 h1:sDSOMWGtf/c+GGG+K6QR7sa7U+7PFJA5jzaQ2MgpE+8= +code.icb4dc0.de/buildr/wasi-module-sdk-go v0.0.0-20230701111906-1f0c58b1c8a4/go.mod h1:4oTtECbg97YmFN2UHoHj4D59Cgq8/GACMjWeRpcyX4o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/docker v24.0.2+incompatible h1:eATx+oLz9WdNVkQrr0qjQ8HvRJ4bOOxfzEo8R+dA3cg= -github.com/docker/docker v24.0.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= -github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= -github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v53 v53.0.0 h1:T1RyHbSnpHYnoF0ZYKiIPSgPtuJ8G6vgc0MKodXsQDQ= -github.com/google/go-github/v53 v53.0.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/hcl/v2 v2.17.0 h1:z1XvSUyXd1HP10U4lrLg5e0JMVz6CPaJvAgxM0KNZVY= -github.com/hashicorp/hcl/v2 v2.17.0/go.mod h1:gJyW2PTShkJqQBKpAmPO3yxMxIuoXkOF2TpqXzrQyx4= -github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= -github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= -github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= @@ -70,108 +22,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tetratelabs/tinymem v0.1.0 h1:Qza1JAg9lquPPJ/CIei5qQYx7t18KLie83O2WR6CM58= github.com/tetratelabs/tinymem v0.1.0/go.mod h1:WFFTZFhLod6lTL+UetFAopVbGaB+KFsVcIY+RUv7NeY= -github.com/tetratelabs/wazero v1.2.0 h1:I/8LMf4YkCZ3r2XaL9whhA0VMyAvF6QE+O7rco0DCeQ= -github.com/tetratelabs/wazero v1.2.0/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.13.2 h1:4GvrUxe/QUDYuJKAav4EYqdM47/kZa672LwmXFmEKT0= -github.com/zclconf/go-cty v1.13.2/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= -golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0 h1:lFO9qtOdlre5W1jxS3r/4szv2/6iXxScdzjoBMXNhYk= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= -golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= 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.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= 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= -lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= -lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= -modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= -modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= -modernc.org/ccgo/v3 v3.16.14 h1:af6KNtFgsVmnDYrWk3PQCS9XT6BXe7o3ZFJKkIKvXNQ= -modernc.org/ccgo/v3 v3.16.14/go.mod h1:mPDSujUIaTNWQSG4eqKw+atqLOEbma6Ncsa94WbC9zo= -modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= -modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= -modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= -modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= -modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= -modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM= -modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= -modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= -modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= -modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= diff --git a/examples/hello_world_go/internal/integration/integration_test.go b/examples/hello_world_go/internal/integration/integration_test.go index cac8747..7546c26 100644 --- a/examples/hello_world_go/internal/integration/integration_test.go +++ b/examples/hello_world_go/internal/integration/integration_test.go @@ -8,12 +8,10 @@ import ( "os" "testing" - "code.icb4dc0.de/buildr/buildr/modules/plugin" - + "github.com/stretchr/testify/mock" "golang.org/x/exp/slog" "code.icb4dc0.de/buildr/buildr/modules" - "github.com/stretchr/testify/mock" mm "hello_world/mocks/modules" ) diff --git a/examples/hello_world_go/module/hello_world.go b/examples/hello_world_go/module/hello_world.go index c15fdfb..ce63bc6 100644 --- a/examples/hello_world_go/module/hello_world.go +++ b/examples/hello_world_go/module/hello_world.go @@ -5,13 +5,16 @@ import ( "os" "code.icb4dc0.de/buildr/wasi-module-sdk-go/exec" - + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" "golang.org/x/exp/slog" sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" ) -var _ sdk.Module = (*HelloWorld)(nil) +var ( + _ sdk.Module = (*HelloWorld)(nil) + _ sdk.Helper = (*HelloWorld)(nil) +) type HelloWorld struct { Name string @@ -53,3 +56,35 @@ func (HelloWorld) Category() sdk.Category { func (HelloWorld) Type() string { return "hello_world" } + +func (h HelloWorld) Help() sdk.Help { + return sdk.Help{ + Name: "Hello World", + Description: `Example to illustrate how to use the Buildr plugin API.`, + Examples: []sdk.Example{ + { + Name: "Simple example", + Description: `well, you know, hello world`, + Spec: sdk.TaskSpec[sdk.Module]{ + ModuleName: "hello_world", + Module: HelloWorld{ + Name: "Ted Tester", + }, + }, + }, + { + Name: "Container example", + Description: `well, you know, hello world, but in a container!`, + Spec: sdk.TaskSpec[sdk.Module]{ + ModuleName: "hello_world", + Module: HelloWorld{ + Name: "Paul Player", + }, + Container: &rpcv1.ContainerSpec{ + Image: "busybox", + }, + }, + }, + }, + } +} diff --git a/exec/command.go b/exec/command.go index afdbec0..6b6f227 100644 --- a/exec/command.go +++ b/exec/command.go @@ -1,10 +1,11 @@ package exec import ( - "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" - rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" "fmt" "io" + + "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" ) func NewCommand(name string, args ...string) *Command { @@ -23,6 +24,14 @@ type Command struct { } func (c *Command) AddEnv(envToAdd map[string]string) { + if envToAdd == nil { + return + } + + if c.Env == nil { + c.Env = make(map[string]string) + } + for k, v := range envToAdd { c.Env[k] = v } diff --git a/go.mod b/go.mod index 8a70a11..bbf450a 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.20 require ( github.com/tetratelabs/tinymem v0.1.0 - golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc - google.golang.org/protobuf v1.30.0 + golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 + google.golang.org/protobuf v1.31.0 ) require github.com/google/go-cmp v0.5.9 // indirect diff --git a/go.sum b/go.sum index e223162..45eb815 100644 --- a/go.sum +++ b/go.sum @@ -4,9 +4,9 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/tetratelabs/tinymem v0.1.0 h1:Qza1JAg9lquPPJ/CIei5qQYx7t18KLie83O2WR6CM58= github.com/tetratelabs/tinymem v0.1.0/go.mod h1:WFFTZFhLod6lTL+UetFAopVbGaB+KFsVcIY+RUv7NeY= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U= +golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/help.go b/help.go index ae5459a..2611880 100644 --- a/help.go +++ b/help.go @@ -1,7 +1,7 @@ package sdk type Example struct { - Spec Module + Spec TaskSpec[Module] Name string Description string } diff --git a/logger.go b/logger.go index b3a377c..ed39672 100644 --- a/logger.go +++ b/logger.go @@ -6,10 +6,9 @@ import "C" import ( "context" - "golang.org/x/exp/slog" - "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" + "golang.org/x/exp/slog" ) var _ slog.Handler = (*WASIHandler)(nil) diff --git a/protocol/constraints.go b/protocol/constraints.go new file mode 100644 index 0000000..b715a7c --- /dev/null +++ b/protocol/constraints.go @@ -0,0 +1,21 @@ +package protocol + +type Signed interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 +} + +type Unsigned interface { + ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr +} + +type Integer interface { + Signed | Unsigned +} + +type Float interface { + ~float32 | ~float64 +} + +type Numeric interface { + Integer | Float +} diff --git a/protocol/generated/rpc/v1/executor.pb.go b/protocol/generated/rpc/v1/executor.pb.go index 8fa77da..67f460a 100644 --- a/protocol/generated/rpc/v1/executor.pb.go +++ b/protocol/generated/rpc/v1/executor.pb.go @@ -91,61 +91,6 @@ func (x *Buildr) GetOutDir() string { return "" } -type ModuleReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ModuleCategory Category `protobuf:"varint,1,opt,name=module_category,json=moduleCategory,proto3,enum=buildr.rpc.v1.Category" json:"module_category,omitempty"` - ModuleType string `protobuf:"bytes,2,opt,name=module_type,json=moduleType,proto3" json:"module_type,omitempty"` -} - -func (x *ModuleReference) Reset() { - *x = ModuleReference{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleReference) ProtoMessage() {} - -func (x *ModuleReference) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_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 ModuleReference.ProtoReflect.Descriptor instead. -func (*ModuleReference) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{1} -} - -func (x *ModuleReference) GetModuleCategory() Category { - if x != nil { - return x.ModuleCategory - } - return Category_CategoryUnknown -} - -func (x *ModuleReference) GetModuleType() string { - if x != nil { - return x.ModuleType - } - return "" -} - type TaskReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -159,7 +104,7 @@ type TaskReference struct { func (x *TaskReference) Reset() { *x = TaskReference{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[2] + mi := &file_rpc_v1_executor_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -172,7 +117,7 @@ func (x *TaskReference) String() string { func (*TaskReference) ProtoMessage() {} func (x *TaskReference) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[2] + mi := &file_rpc_v1_executor_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -185,7 +130,7 @@ func (x *TaskReference) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskReference.ProtoReflect.Descriptor instead. func (*TaskReference) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{2} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{1} } func (x *TaskReference) GetId() string { @@ -216,13 +161,13 @@ type StartTaskRequest struct { Reference *TaskReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` Buildr *Buildr `protobuf:"bytes,2,opt,name=buildr,proto3" json:"buildr,omitempty"` - RawTask []byte `protobuf:"bytes,3,opt,name=raw_task,json=rawTask,proto3" json:"raw_task,omitempty"` + Spec *ModuleSpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` } func (x *StartTaskRequest) Reset() { *x = StartTaskRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[3] + mi := &file_rpc_v1_executor_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -235,7 +180,7 @@ func (x *StartTaskRequest) String() string { func (*StartTaskRequest) ProtoMessage() {} func (x *StartTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[3] + mi := &file_rpc_v1_executor_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -248,7 +193,7 @@ func (x *StartTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartTaskRequest.ProtoReflect.Descriptor instead. func (*StartTaskRequest) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{3} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{2} } func (x *StartTaskRequest) GetReference() *TaskReference { @@ -265,9 +210,9 @@ func (x *StartTaskRequest) GetBuildr() *Buildr { return nil } -func (x *StartTaskRequest) GetRawTask() []byte { +func (x *StartTaskRequest) GetSpec() *ModuleSpec { if x != nil { - return x.RawTask + return x.Spec } return nil } @@ -284,7 +229,7 @@ type TaskResult struct { func (x *TaskResult) Reset() { *x = TaskResult{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[4] + mi := &file_rpc_v1_executor_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -297,7 +242,7 @@ func (x *TaskResult) String() string { func (*TaskResult) ProtoMessage() {} func (x *TaskResult) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[4] + mi := &file_rpc_v1_executor_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -310,7 +255,7 @@ func (x *TaskResult) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskResult.ProtoReflect.Descriptor instead. func (*TaskResult) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{3} } func (x *TaskResult) GetError() string { @@ -341,7 +286,7 @@ type TaskLog struct { func (x *TaskLog) Reset() { *x = TaskLog{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[5] + mi := &file_rpc_v1_executor_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -354,7 +299,7 @@ func (x *TaskLog) String() string { func (*TaskLog) ProtoMessage() {} func (x *TaskLog) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[5] + mi := &file_rpc_v1_executor_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -367,7 +312,7 @@ func (x *TaskLog) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskLog.ProtoReflect.Descriptor instead. func (*TaskLog) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4} } func (x *TaskLog) GetTime() int64 { @@ -410,7 +355,7 @@ type SetState struct { func (x *SetState) Reset() { *x = SetState{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[6] + mi := &file_rpc_v1_executor_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -423,7 +368,7 @@ func (x *SetState) String() string { func (*SetState) ProtoMessage() {} func (x *SetState) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[6] + mi := &file_rpc_v1_executor_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -436,7 +381,7 @@ func (x *SetState) ProtoReflect() protoreflect.Message { // Deprecated: Use SetState.ProtoReflect.Descriptor instead. func (*SetState) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{6} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5} } func (x *SetState) GetKey() []byte { @@ -464,7 +409,7 @@ type GetStateRequest struct { func (x *GetStateRequest) Reset() { *x = GetStateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[7] + mi := &file_rpc_v1_executor_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -477,7 +422,7 @@ func (x *GetStateRequest) String() string { func (*GetStateRequest) ProtoMessage() {} func (x *GetStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[7] + mi := &file_rpc_v1_executor_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -490,7 +435,7 @@ func (x *GetStateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateRequest.ProtoReflect.Descriptor instead. func (*GetStateRequest) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{7} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{6} } func (x *GetStateRequest) GetKey() []byte { @@ -512,7 +457,7 @@ type GetStateResponse struct { func (x *GetStateResponse) Reset() { *x = GetStateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[8] + mi := &file_rpc_v1_executor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -525,7 +470,7 @@ func (x *GetStateResponse) String() string { func (*GetStateResponse) ProtoMessage() {} func (x *GetStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[8] + mi := &file_rpc_v1_executor_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -538,7 +483,7 @@ func (x *GetStateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetStateResponse.ProtoReflect.Descriptor instead. func (*GetStateResponse) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{8} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{7} } func (x *GetStateResponse) GetKey() []byte { @@ -567,7 +512,7 @@ type Result struct { func (x *Result) Reset() { *x = Result{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[9] + mi := &file_rpc_v1_executor_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -580,7 +525,7 @@ func (x *Result) String() string { func (*Result) ProtoMessage() {} func (x *Result) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[9] + mi := &file_rpc_v1_executor_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -593,7 +538,7 @@ func (x *Result) ProtoReflect() protoreflect.Message { // Deprecated: Use Result.ProtoReflect.Descriptor instead. func (*Result) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{9} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{8} } func (x *Result) GetSuccess() bool { @@ -621,7 +566,7 @@ type PluginInventory struct { func (x *PluginInventory) Reset() { *x = PluginInventory{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[10] + mi := &file_rpc_v1_executor_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -634,7 +579,7 @@ func (x *PluginInventory) String() string { func (*PluginInventory) ProtoMessage() {} func (x *PluginInventory) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[10] + mi := &file_rpc_v1_executor_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -647,7 +592,7 @@ func (x *PluginInventory) ProtoReflect() protoreflect.Message { // Deprecated: Use PluginInventory.ProtoReflect.Descriptor instead. func (*PluginInventory) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{10} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{9} } func (x *PluginInventory) GetModules() []*ModuleReference { @@ -668,7 +613,7 @@ type Buildr_Repo struct { func (x *Buildr_Repo) Reset() { *x = Buildr_Repo{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[11] + mi := &file_rpc_v1_executor_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -681,7 +626,7 @@ func (x *Buildr_Repo) String() string { func (*Buildr_Repo) ProtoMessage() {} func (x *Buildr_Repo) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[11] + mi := &file_rpc_v1_executor_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -715,7 +660,7 @@ type Buildr_GitHub struct { func (x *Buildr_GitHub) Reset() { *x = Buildr_GitHub{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[12] + mi := &file_rpc_v1_executor_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -728,7 +673,7 @@ func (x *Buildr_GitHub) String() string { func (*Buildr_GitHub) ProtoMessage() {} func (x *Buildr_GitHub) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[12] + mi := &file_rpc_v1_executor_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -763,7 +708,7 @@ type TaskLog_LogAttribute struct { func (x *TaskLog_LogAttribute) Reset() { *x = TaskLog_LogAttribute{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_executor_proto_msgTypes[13] + mi := &file_rpc_v1_executor_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -776,7 +721,7 @@ func (x *TaskLog_LogAttribute) String() string { func (*TaskLog_LogAttribute) ProtoMessage() {} func (x *TaskLog_LogAttribute) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_executor_proto_msgTypes[13] + mi := &file_rpc_v1_executor_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -789,7 +734,7 @@ func (x *TaskLog_LogAttribute) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskLog_LogAttribute.ProtoReflect.Descriptor instead. func (*TaskLog_LogAttribute) Descriptor() ([]byte, []int) { - return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5, 0} + return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4, 0} } func (x *TaskLog_LogAttribute) GetKey() string { @@ -827,79 +772,73 @@ var file_rpc_v1_executor_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x1a, 0x25, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x48, 0x75, 0x62, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x70, 0x69, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x70, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x74, 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x63, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6b, 0x0a, 0x0d, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, + 0x6b, 0x0a, 0x0d, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0xac, 0x01, 0x0a, + 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x0a, + 0x06, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, + 0x69, 0x6c, 0x64, 0x72, 0x52, 0x06, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x12, 0x2d, 0x0a, 0x04, + 0x73, 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x52, 0x06, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x61, 0x77, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x61, 0x77, 0x54, 0x61, 0x73, 0x6b, 0x22, 0x61, 0x0a, - 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x3d, 0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, - 0x22, 0xca, 0x01, 0x0a, 0x07, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 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, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x12, 0x43, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, - 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, - 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x73, 0x1a, 0x36, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 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, 0x22, 0x30, 0x0a, - 0x08, 0x53, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0x23, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x22, 0x38, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x38, - 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x4b, 0x0a, 0x0f, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x07, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, - 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x42, 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, 0x63, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, - 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x53, 0x70, 0x65, 0x63, 0x52, 0x04, 0x73, 0x70, 0x65, 0x63, 0x22, 0x61, 0x0a, 0x0a, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x3d, 0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x6c, 0x65, + 0x73, 0x5f, 0x61, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x46, 0x69, + 0x6c, 0x65, 0x73, 0x41, 0x72, 0x63, 0x68, 0x69, 0x76, 0x65, 0x50, 0x61, 0x74, 0x68, 0x22, 0xca, + 0x01, 0x0a, 0x07, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x69, 0x6d, 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, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x43, + 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x4c, 0x6f, 0x67, 0x2e, 0x4c, 0x6f, 0x67, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x73, 0x1a, 0x36, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 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, 0x22, 0x30, 0x0a, 0x08, 0x53, + 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x23, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x22, 0x38, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x38, 0x0a, 0x06, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x4b, 0x0a, 0x0f, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, + 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, + 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x73, 0x42, 0xb9, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, 0x64, 0x65, + 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2d, 0x73, + 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, + 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x52, + 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, + 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, + 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, + 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -914,33 +853,33 @@ func file_rpc_v1_executor_proto_rawDescGZIP() []byte { return file_rpc_v1_executor_proto_rawDescData } -var file_rpc_v1_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_rpc_v1_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_rpc_v1_executor_proto_goTypes = []interface{}{ (*Buildr)(nil), // 0: buildr.rpc.v1.Buildr - (*ModuleReference)(nil), // 1: buildr.rpc.v1.ModuleReference - (*TaskReference)(nil), // 2: buildr.rpc.v1.TaskReference - (*StartTaskRequest)(nil), // 3: buildr.rpc.v1.StartTaskRequest - (*TaskResult)(nil), // 4: buildr.rpc.v1.TaskResult - (*TaskLog)(nil), // 5: buildr.rpc.v1.TaskLog - (*SetState)(nil), // 6: buildr.rpc.v1.SetState - (*GetStateRequest)(nil), // 7: buildr.rpc.v1.GetStateRequest - (*GetStateResponse)(nil), // 8: buildr.rpc.v1.GetStateResponse - (*Result)(nil), // 9: buildr.rpc.v1.Result - (*PluginInventory)(nil), // 10: buildr.rpc.v1.PluginInventory - (*Buildr_Repo)(nil), // 11: buildr.rpc.v1.Buildr.Repo - (*Buildr_GitHub)(nil), // 12: buildr.rpc.v1.Buildr.GitHub - (*TaskLog_LogAttribute)(nil), // 13: buildr.rpc.v1.TaskLog.LogAttribute - (Category)(0), // 14: buildr.rpc.v1.Category + (*TaskReference)(nil), // 1: buildr.rpc.v1.TaskReference + (*StartTaskRequest)(nil), // 2: buildr.rpc.v1.StartTaskRequest + (*TaskResult)(nil), // 3: buildr.rpc.v1.TaskResult + (*TaskLog)(nil), // 4: buildr.rpc.v1.TaskLog + (*SetState)(nil), // 5: buildr.rpc.v1.SetState + (*GetStateRequest)(nil), // 6: buildr.rpc.v1.GetStateRequest + (*GetStateResponse)(nil), // 7: buildr.rpc.v1.GetStateResponse + (*Result)(nil), // 8: buildr.rpc.v1.Result + (*PluginInventory)(nil), // 9: buildr.rpc.v1.PluginInventory + (*Buildr_Repo)(nil), // 10: buildr.rpc.v1.Buildr.Repo + (*Buildr_GitHub)(nil), // 11: buildr.rpc.v1.Buildr.GitHub + (*TaskLog_LogAttribute)(nil), // 12: buildr.rpc.v1.TaskLog.LogAttribute + (*ModuleReference)(nil), // 13: buildr.rpc.v1.ModuleReference + (*ModuleSpec)(nil), // 14: buildr.rpc.v1.ModuleSpec } var file_rpc_v1_executor_proto_depIdxs = []int32{ - 11, // 0: buildr.rpc.v1.Buildr.repo:type_name -> buildr.rpc.v1.Buildr.Repo - 12, // 1: buildr.rpc.v1.Buildr.github:type_name -> buildr.rpc.v1.Buildr.GitHub - 14, // 2: buildr.rpc.v1.ModuleReference.module_category:type_name -> buildr.rpc.v1.Category - 1, // 3: buildr.rpc.v1.TaskReference.module:type_name -> buildr.rpc.v1.ModuleReference - 2, // 4: buildr.rpc.v1.StartTaskRequest.reference:type_name -> buildr.rpc.v1.TaskReference - 0, // 5: buildr.rpc.v1.StartTaskRequest.buildr:type_name -> buildr.rpc.v1.Buildr - 13, // 6: buildr.rpc.v1.TaskLog.attributes:type_name -> buildr.rpc.v1.TaskLog.LogAttribute - 1, // 7: buildr.rpc.v1.PluginInventory.modules:type_name -> buildr.rpc.v1.ModuleReference + 10, // 0: buildr.rpc.v1.Buildr.repo:type_name -> buildr.rpc.v1.Buildr.Repo + 11, // 1: buildr.rpc.v1.Buildr.github:type_name -> buildr.rpc.v1.Buildr.GitHub + 13, // 2: buildr.rpc.v1.TaskReference.module:type_name -> buildr.rpc.v1.ModuleReference + 1, // 3: buildr.rpc.v1.StartTaskRequest.reference:type_name -> buildr.rpc.v1.TaskReference + 0, // 4: buildr.rpc.v1.StartTaskRequest.buildr:type_name -> buildr.rpc.v1.Buildr + 14, // 5: buildr.rpc.v1.StartTaskRequest.spec:type_name -> buildr.rpc.v1.ModuleSpec + 12, // 6: buildr.rpc.v1.TaskLog.attributes:type_name -> buildr.rpc.v1.TaskLog.LogAttribute + 13, // 7: buildr.rpc.v1.PluginInventory.modules:type_name -> buildr.rpc.v1.ModuleReference 8, // [8:8] is the sub-list for method output_type 8, // [8:8] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name @@ -968,18 +907,6 @@ func file_rpc_v1_executor_proto_init() { } } file_rpc_v1_executor_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_v1_executor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TaskReference); i { case 0: return &v.state @@ -991,7 +918,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StartTaskRequest); i { case 0: return &v.state @@ -1003,7 +930,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TaskResult); i { case 0: return &v.state @@ -1015,7 +942,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TaskLog); i { case 0: return &v.state @@ -1027,7 +954,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetState); i { case 0: return &v.state @@ -1039,7 +966,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateRequest); i { case 0: return &v.state @@ -1051,7 +978,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetStateResponse); i { case 0: return &v.state @@ -1063,7 +990,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Result); i { case 0: return &v.state @@ -1075,7 +1002,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PluginInventory); i { case 0: return &v.state @@ -1087,7 +1014,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Buildr_Repo); i { case 0: return &v.state @@ -1099,7 +1026,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Buildr_GitHub); i { case 0: return &v.state @@ -1111,7 +1038,7 @@ func file_rpc_v1_executor_proto_init() { return nil } } - file_rpc_v1_executor_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_rpc_v1_executor_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TaskLog_LogAttribute); i { case 0: return &v.state @@ -1130,7 +1057,7 @@ func file_rpc_v1_executor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rpc_v1_executor_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/generated/rpc/v1/executor_vtproto.pb.go b/protocol/generated/rpc/v1/executor_vtproto.pb.go index e4a268c..e2e978b 100644 --- a/protocol/generated/rpc/v1/executor_vtproto.pb.go +++ b/protocol/generated/rpc/v1/executor_vtproto.pb.go @@ -164,51 +164,6 @@ func (m *Buildr) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ModuleReference) MarshalVT() (dAtA []byte, err error) { - if m == nil { - return nil, nil - } - size := m.SizeVT() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBufferVT(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ModuleReference) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ModuleReference) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - if m == nil { - return 0, nil - } - i := len(dAtA) - _ = i - var l int - _ = l - if m.unknownFields != nil { - i -= len(m.unknownFields) - copy(dAtA[i:], m.unknownFields) - } - if len(m.ModuleType) > 0 { - i -= len(m.ModuleType) - copy(dAtA[i:], m.ModuleType) - i = encodeVarint(dAtA, i, uint64(len(m.ModuleType))) - i-- - dAtA[i] = 0x12 - } - if m.ModuleCategory != 0 { - i = encodeVarint(dAtA, i, uint64(m.ModuleCategory)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func (m *TaskReference) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -296,10 +251,13 @@ func (m *StartTaskRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.RawTask) > 0 { - i -= len(m.RawTask) - copy(dAtA[i:], m.RawTask) - i = encodeVarint(dAtA, i, uint64(len(m.RawTask))) + if m.Spec != nil { + size, err := m.Spec.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -765,23 +723,6 @@ func (m *Buildr) SizeVT() (n int) { return n } -func (m *ModuleReference) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ModuleCategory != 0 { - n += 1 + sov(uint64(m.ModuleCategory)) - } - l = len(m.ModuleType) - if l > 0 { - n += 1 + l + sov(uint64(l)) - } - n += len(m.unknownFields) - return n -} - func (m *TaskReference) SizeVT() (n int) { if m == nil { return 0 @@ -818,8 +759,8 @@ func (m *StartTaskRequest) SizeVT() (n int) { l = m.Buildr.SizeVT() n += 1 + l + sov(uint64(l)) } - l = len(m.RawTask) - if l > 0 { + if m.Spec != nil { + l = m.Spec.SizeVT() n += 1 + l + sov(uint64(l)) } n += len(m.unknownFields) @@ -1324,108 +1265,6 @@ func (m *Buildr) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ModuleReference) UnmarshalVT(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ModuleReference: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ModuleReference: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleCategory", wireType) - } - m.ModuleCategory = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ModuleCategory |= Category(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleType", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ModuleType = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *TaskReference) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -1680,9 +1519,9 @@ func (m *StartTaskRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RawTask", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -1692,24 +1531,26 @@ func (m *StartTaskRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.RawTask = append(m.RawTask[:0], dAtA[iNdEx:postIndex]...) - if m.RawTask == nil { - m.RawTask = []byte{} + if m.Spec == nil { + m.Spec = &ModuleSpec{} + } + if err := m.Spec.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex default: diff --git a/protocol/generated/rpc/v1/spec.pb.go b/protocol/generated/rpc/v1/spec.pb.go index 2afe52b..6c450d4 100644 --- a/protocol/generated/rpc/v1/spec.pb.go +++ b/protocol/generated/rpc/v1/spec.pb.go @@ -75,18 +75,133 @@ func (Category) EnumDescriptor() ([]byte, []int) { return file_rpc_v1_spec_proto_rawDescGZIP(), []int{0} } -type ModuleDescription struct { +type ModuleSpec_ValueKind int32 + +const ( + ModuleSpec_ValueKindUnknown ModuleSpec_ValueKind = 0 + ModuleSpec_ValueKindAttribute ModuleSpec_ValueKind = 1 + ModuleSpec_ValueKindLabel ModuleSpec_ValueKind = 2 + ModuleSpec_ValueKindBlock ModuleSpec_ValueKind = 4 +) + +// Enum value maps for ModuleSpec_ValueKind. +var ( + ModuleSpec_ValueKind_name = map[int32]string{ + 0: "ValueKindUnknown", + 1: "ValueKindAttribute", + 2: "ValueKindLabel", + 4: "ValueKindBlock", + } + ModuleSpec_ValueKind_value = map[string]int32{ + "ValueKindUnknown": 0, + "ValueKindAttribute": 1, + "ValueKindLabel": 2, + "ValueKindBlock": 4, + } +) + +func (x ModuleSpec_ValueKind) Enum() *ModuleSpec_ValueKind { + p := new(ModuleSpec_ValueKind) + *p = x + return p +} + +func (x ModuleSpec_ValueKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ModuleSpec_ValueKind) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_v1_spec_proto_enumTypes[1].Descriptor() +} + +func (ModuleSpec_ValueKind) Type() protoreflect.EnumType { + return &file_rpc_v1_spec_proto_enumTypes[1] +} + +func (x ModuleSpec_ValueKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ModuleSpec_ValueKind.Descriptor instead. +func (ModuleSpec_ValueKind) EnumDescriptor() ([]byte, []int) { + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{1, 0} +} + +type ModuleSpec_ValueType int32 + +const ( + ModuleSpec_ValueTypeUnknown ModuleSpec_ValueType = 0 + ModuleSpec_ValueTypeSingle ModuleSpec_ValueType = 1 + ModuleSpec_ValueTypeObject ModuleSpec_ValueType = 2 + ModuleSpec_ValueTypeMap ModuleSpec_ValueType = 3 + ModuleSpec_ValueTypeStringSlice ModuleSpec_ValueType = 4 + ModuleSpec_ValueTypeIntSlice ModuleSpec_ValueType = 5 + ModuleSpec_ValueTypeDoubleSlice ModuleSpec_ValueType = 6 + ModuleSpec_ValueTypeBoolSlice ModuleSpec_ValueType = 7 +) + +// Enum value maps for ModuleSpec_ValueType. +var ( + ModuleSpec_ValueType_name = map[int32]string{ + 0: "ValueTypeUnknown", + 1: "ValueTypeSingle", + 2: "ValueTypeObject", + 3: "ValueTypeMap", + 4: "ValueTypeStringSlice", + 5: "ValueTypeIntSlice", + 6: "ValueTypeDoubleSlice", + 7: "ValueTypeBoolSlice", + } + ModuleSpec_ValueType_value = map[string]int32{ + "ValueTypeUnknown": 0, + "ValueTypeSingle": 1, + "ValueTypeObject": 2, + "ValueTypeMap": 3, + "ValueTypeStringSlice": 4, + "ValueTypeIntSlice": 5, + "ValueTypeDoubleSlice": 6, + "ValueTypeBoolSlice": 7, + } +) + +func (x ModuleSpec_ValueType) Enum() *ModuleSpec_ValueType { + p := new(ModuleSpec_ValueType) + *p = x + return p +} + +func (x ModuleSpec_ValueType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ModuleSpec_ValueType) Descriptor() protoreflect.EnumDescriptor { + return file_rpc_v1_spec_proto_enumTypes[2].Descriptor() +} + +func (ModuleSpec_ValueType) Type() protoreflect.EnumType { + return &file_rpc_v1_spec_proto_enumTypes[2] +} + +func (x ModuleSpec_ValueType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ModuleSpec_ValueType.Descriptor instead. +func (ModuleSpec_ValueType) EnumDescriptor() ([]byte, []int) { + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{1, 1} +} + +type ModuleReference struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Category Category `protobuf:"varint,1,opt,name=category,proto3,enum=buildr.rpc.v1.Category" json:"category,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - DescriptionValues []*ModuleDescription_DescriptionValue `protobuf:"bytes,3,rep,name=description_values,json=descriptionValues,proto3" json:"description_values,omitempty"` + ModuleCategory Category `protobuf:"varint,1,opt,name=module_category,json=moduleCategory,proto3,enum=buildr.rpc.v1.Category" json:"module_category,omitempty"` + ModuleType string `protobuf:"bytes,2,opt,name=module_type,json=moduleType,proto3" json:"module_type,omitempty"` } -func (x *ModuleDescription) Reset() { - *x = ModuleDescription{} +func (x *ModuleReference) Reset() { + *x = ModuleReference{} if protoimpl.UnsafeEnabled { mi := &file_rpc_v1_spec_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -94,13 +209,13 @@ func (x *ModuleDescription) Reset() { } } -func (x *ModuleDescription) String() string { +func (x *ModuleReference) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ModuleDescription) ProtoMessage() {} +func (*ModuleReference) ProtoMessage() {} -func (x *ModuleDescription) ProtoReflect() protoreflect.Message { +func (x *ModuleReference) ProtoReflect() protoreflect.Message { mi := &file_rpc_v1_spec_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -112,28 +227,84 @@ func (x *ModuleDescription) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ModuleDescription.ProtoReflect.Descriptor instead. -func (*ModuleDescription) Descriptor() ([]byte, []int) { +// Deprecated: Use ModuleReference.ProtoReflect.Descriptor instead. +func (*ModuleReference) Descriptor() ([]byte, []int) { return file_rpc_v1_spec_proto_rawDescGZIP(), []int{0} } -func (x *ModuleDescription) GetCategory() Category { +func (x *ModuleReference) GetModuleCategory() Category { + if x != nil { + return x.ModuleCategory + } + return Category_CategoryUnknown +} + +func (x *ModuleReference) GetModuleType() string { + if x != nil { + return x.ModuleType + } + return "" +} + +type ModuleSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Category Category `protobuf:"varint,1,opt,name=category,proto3,enum=buildr.rpc.v1.Category" json:"category,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Values map[string]*ModuleSpec_Value `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ModuleSpec) Reset() { + *x = ModuleSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_v1_spec_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ModuleSpec) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ModuleSpec) ProtoMessage() {} + +func (x *ModuleSpec) ProtoReflect() protoreflect.Message { + mi := &file_rpc_v1_spec_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ModuleSpec.ProtoReflect.Descriptor instead. +func (*ModuleSpec) Descriptor() ([]byte, []int) { + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{1} +} + +func (x *ModuleSpec) GetCategory() Category { if x != nil { return x.Category } return Category_CategoryUnknown } -func (x *ModuleDescription) GetType() string { +func (x *ModuleSpec) GetType() string { if x != nil { return x.Type } return "" } -func (x *ModuleDescription) GetDescriptionValues() []*ModuleDescription_DescriptionValue { +func (x *ModuleSpec) GetValues() map[string]*ModuleSpec_Value { if x != nil { - return x.DescriptionValues + return x.Values } return nil } @@ -150,7 +321,7 @@ type ContainerCapabilities struct { func (x *ContainerCapabilities) Reset() { *x = ContainerCapabilities{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[1] + mi := &file_rpc_v1_spec_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -163,7 +334,7 @@ func (x *ContainerCapabilities) String() string { func (*ContainerCapabilities) ProtoMessage() {} func (x *ContainerCapabilities) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[1] + mi := &file_rpc_v1_spec_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -176,7 +347,7 @@ func (x *ContainerCapabilities) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerCapabilities.ProtoReflect.Descriptor instead. func (*ContainerCapabilities) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{1} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{2} } func (x *ContainerCapabilities) GetAdd() []string { @@ -206,7 +377,7 @@ type ContainerBindMount struct { func (x *ContainerBindMount) Reset() { *x = ContainerBindMount{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[2] + mi := &file_rpc_v1_spec_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -219,7 +390,7 @@ func (x *ContainerBindMount) String() string { func (*ContainerBindMount) ProtoMessage() {} func (x *ContainerBindMount) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[2] + mi := &file_rpc_v1_spec_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -232,7 +403,7 @@ func (x *ContainerBindMount) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerBindMount.ProtoReflect.Descriptor instead. func (*ContainerBindMount) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{2} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{3} } func (x *ContainerBindMount) GetTarget() string { @@ -269,7 +440,7 @@ type ContainerTmpfsMount struct { func (x *ContainerTmpfsMount) Reset() { *x = ContainerTmpfsMount{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[3] + mi := &file_rpc_v1_spec_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -282,7 +453,7 @@ func (x *ContainerTmpfsMount) String() string { func (*ContainerTmpfsMount) ProtoMessage() {} func (x *ContainerTmpfsMount) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[3] + mi := &file_rpc_v1_spec_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -295,7 +466,7 @@ func (x *ContainerTmpfsMount) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerTmpfsMount.ProtoReflect.Descriptor instead. func (*ContainerTmpfsMount) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{3} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{4} } func (x *ContainerTmpfsMount) GetTarget() string { @@ -333,7 +504,7 @@ type ContainerVolumeMount struct { func (x *ContainerVolumeMount) Reset() { *x = ContainerVolumeMount{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[4] + mi := &file_rpc_v1_spec_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -346,7 +517,7 @@ func (x *ContainerVolumeMount) String() string { func (*ContainerVolumeMount) ProtoMessage() {} func (x *ContainerVolumeMount) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[4] + mi := &file_rpc_v1_spec_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -359,7 +530,7 @@ func (x *ContainerVolumeMount) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerVolumeMount.ProtoReflect.Descriptor instead. func (*ContainerVolumeMount) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{4} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{5} } func (x *ContainerVolumeMount) GetTarget() string { @@ -407,7 +578,7 @@ type ContainerSpec struct { func (x *ContainerSpec) Reset() { *x = ContainerSpec{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[5] + mi := &file_rpc_v1_spec_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -420,7 +591,7 @@ func (x *ContainerSpec) String() string { func (*ContainerSpec) ProtoMessage() {} func (x *ContainerSpec) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[5] + mi := &file_rpc_v1_spec_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -433,7 +604,7 @@ func (x *ContainerSpec) ProtoReflect() protoreflect.Message { // Deprecated: Use ContainerSpec.ProtoReflect.Descriptor instead. func (*ContainerSpec) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{5} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{6} } func (x *ContainerSpec) GetImage() string { @@ -490,17 +661,16 @@ type TaskSpec struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ModuleName string `protobuf:"bytes,1,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"` - ModuleDescription *ModuleDescription `protobuf:"bytes,2,opt,name=module_description,json=moduleDescription,proto3" json:"module_description,omitempty"` - InputMapping map[string]string `protobuf:"bytes,3,rep,name=input_mapping,json=inputMapping,proto3" json:"input_mapping,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Container *ContainerSpec `protobuf:"bytes,4,opt,name=container,proto3" json:"container,omitempty"` - OutputDir string `protobuf:"bytes,5,opt,name=output_dir,json=outputDir,proto3" json:"output_dir,omitempty"` + ModuleName string `protobuf:"bytes,1,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"` + ModuleSpec *ModuleSpec `protobuf:"bytes,2,opt,name=module_spec,json=moduleSpec,proto3" json:"module_spec,omitempty"` + Container *ContainerSpec `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"` + OutputDir string `protobuf:"bytes,4,opt,name=output_dir,json=outputDir,proto3" json:"output_dir,omitempty"` } func (x *TaskSpec) Reset() { *x = TaskSpec{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[6] + mi := &file_rpc_v1_spec_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -513,7 +683,7 @@ func (x *TaskSpec) String() string { func (*TaskSpec) ProtoMessage() {} func (x *TaskSpec) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[6] + mi := &file_rpc_v1_spec_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -526,7 +696,7 @@ func (x *TaskSpec) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskSpec.ProtoReflect.Descriptor instead. func (*TaskSpec) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{6} + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{7} } func (x *TaskSpec) GetModuleName() string { @@ -536,16 +706,9 @@ func (x *TaskSpec) GetModuleName() string { return "" } -func (x *TaskSpec) GetModuleDescription() *ModuleDescription { +func (x *TaskSpec) GetModuleSpec() *ModuleSpec { if x != nil { - return x.ModuleDescription - } - return nil -} - -func (x *TaskSpec) GetInputMapping() map[string]string { - if x != nil { - return x.InputMapping + return x.ModuleSpec } return nil } @@ -564,39 +727,44 @@ func (x *TaskSpec) GetOutputDir() string { return "" } -type ModuleDescription_DescriptionValue struct { +type ModuleSpec_Value struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // Types that are assignable to Value: + Type ModuleSpec_ValueType `protobuf:"varint,1,opt,name=type,proto3,enum=buildr.rpc.v1.ModuleSpec_ValueType" json:"type,omitempty"` + Kind ModuleSpec_ValueKind `protobuf:"varint,2,opt,name=kind,proto3,enum=buildr.rpc.v1.ModuleSpec_ValueKind" json:"kind,omitempty"` + ComplexValue map[string]*ModuleSpec_Value `protobuf:"bytes,10,rep,name=complex_value,json=complexValue,proto3" json:"complex_value,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Types that are assignable to SingleValue: // - // *ModuleDescription_DescriptionValue_StringValue - // *ModuleDescription_DescriptionValue_IntValue - // *ModuleDescription_DescriptionValue_DoubleValue - // *ModuleDescription_DescriptionValue_BoolValue - // *ModuleDescription_DescriptionValue_NestedValue - Value isModuleDescription_DescriptionValue_Value `protobuf_oneof:"value"` + // *ModuleSpec_Value_StringValue + // *ModuleSpec_Value_IntValue + // *ModuleSpec_Value_DoubleValue + // *ModuleSpec_Value_BoolValue + SingleValue isModuleSpec_Value_SingleValue `protobuf_oneof:"single_value"` + StringValues []string `protobuf:"bytes,21,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` + IntValues []int64 `protobuf:"varint,22,rep,packed,name=int_values,json=intValues,proto3" json:"int_values,omitempty"` + DoubleValues []float64 `protobuf:"fixed64,23,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` + BoolValues []bool `protobuf:"varint,24,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` } -func (x *ModuleDescription_DescriptionValue) Reset() { - *x = ModuleDescription_DescriptionValue{} +func (x *ModuleSpec_Value) Reset() { + *x = ModuleSpec_Value{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_v1_spec_proto_msgTypes[7] + mi := &file_rpc_v1_spec_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ModuleDescription_DescriptionValue) String() string { +func (x *ModuleSpec_Value) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ModuleDescription_DescriptionValue) ProtoMessage() {} +func (*ModuleSpec_Value) ProtoMessage() {} -func (x *ModuleDescription_DescriptionValue) ProtoReflect() protoreflect.Message { - mi := &file_rpc_v1_spec_proto_msgTypes[7] +func (x *ModuleSpec_Value) ProtoReflect() protoreflect.Message { + mi := &file_rpc_v1_spec_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -607,199 +775,267 @@ func (x *ModuleDescription_DescriptionValue) ProtoReflect() protoreflect.Message return mi.MessageOf(x) } -// Deprecated: Use ModuleDescription_DescriptionValue.ProtoReflect.Descriptor instead. -func (*ModuleDescription_DescriptionValue) Descriptor() ([]byte, []int) { - return file_rpc_v1_spec_proto_rawDescGZIP(), []int{0, 0} +// Deprecated: Use ModuleSpec_Value.ProtoReflect.Descriptor instead. +func (*ModuleSpec_Value) Descriptor() ([]byte, []int) { + return file_rpc_v1_spec_proto_rawDescGZIP(), []int{1, 0} } -func (x *ModuleDescription_DescriptionValue) GetKey() string { +func (x *ModuleSpec_Value) GetType() ModuleSpec_ValueType { if x != nil { - return x.Key + return x.Type } - return "" + return ModuleSpec_ValueTypeUnknown } -func (m *ModuleDescription_DescriptionValue) GetValue() isModuleDescription_DescriptionValue_Value { - if m != nil { - return m.Value +func (x *ModuleSpec_Value) GetKind() ModuleSpec_ValueKind { + if x != nil { + return x.Kind + } + return ModuleSpec_ValueKindUnknown +} + +func (x *ModuleSpec_Value) GetComplexValue() map[string]*ModuleSpec_Value { + if x != nil { + return x.ComplexValue } return nil } -func (x *ModuleDescription_DescriptionValue) GetStringValue() string { - if x, ok := x.GetValue().(*ModuleDescription_DescriptionValue_StringValue); ok { +func (m *ModuleSpec_Value) GetSingleValue() isModuleSpec_Value_SingleValue { + if m != nil { + return m.SingleValue + } + return nil +} + +func (x *ModuleSpec_Value) GetStringValue() string { + if x, ok := x.GetSingleValue().(*ModuleSpec_Value_StringValue); ok { return x.StringValue } return "" } -func (x *ModuleDescription_DescriptionValue) GetIntValue() int64 { - if x, ok := x.GetValue().(*ModuleDescription_DescriptionValue_IntValue); ok { +func (x *ModuleSpec_Value) GetIntValue() int64 { + if x, ok := x.GetSingleValue().(*ModuleSpec_Value_IntValue); ok { return x.IntValue } return 0 } -func (x *ModuleDescription_DescriptionValue) GetDoubleValue() float64 { - if x, ok := x.GetValue().(*ModuleDescription_DescriptionValue_DoubleValue); ok { +func (x *ModuleSpec_Value) GetDoubleValue() float64 { + if x, ok := x.GetSingleValue().(*ModuleSpec_Value_DoubleValue); ok { return x.DoubleValue } return 0 } -func (x *ModuleDescription_DescriptionValue) GetBoolValue() bool { - if x, ok := x.GetValue().(*ModuleDescription_DescriptionValue_BoolValue); ok { +func (x *ModuleSpec_Value) GetBoolValue() bool { + if x, ok := x.GetSingleValue().(*ModuleSpec_Value_BoolValue); ok { return x.BoolValue } return false } -func (x *ModuleDescription_DescriptionValue) GetNestedValue() *ModuleDescription_DescriptionValue { - if x, ok := x.GetValue().(*ModuleDescription_DescriptionValue_NestedValue); ok { - return x.NestedValue +func (x *ModuleSpec_Value) GetStringValues() []string { + if x != nil { + return x.StringValues } return nil } -type isModuleDescription_DescriptionValue_Value interface { - isModuleDescription_DescriptionValue_Value() +func (x *ModuleSpec_Value) GetIntValues() []int64 { + if x != nil { + return x.IntValues + } + return nil } -type ModuleDescription_DescriptionValue_StringValue struct { - StringValue string `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"` +func (x *ModuleSpec_Value) GetDoubleValues() []float64 { + if x != nil { + return x.DoubleValues + } + return nil } -type ModuleDescription_DescriptionValue_IntValue struct { - IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"` +func (x *ModuleSpec_Value) GetBoolValues() []bool { + if x != nil { + return x.BoolValues + } + return nil } -type ModuleDescription_DescriptionValue_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,4,opt,name=double_value,json=doubleValue,proto3,oneof"` +type isModuleSpec_Value_SingleValue interface { + isModuleSpec_Value_SingleValue() } -type ModuleDescription_DescriptionValue_BoolValue struct { - BoolValue bool `protobuf:"varint,5,opt,name=bool_value,json=boolValue,proto3,oneof"` +type ModuleSpec_Value_StringValue struct { + StringValue string `protobuf:"bytes,11,opt,name=string_value,json=stringValue,proto3,oneof"` } -type ModuleDescription_DescriptionValue_NestedValue struct { - NestedValue *ModuleDescription_DescriptionValue `protobuf:"bytes,6,opt,name=nested_value,json=nestedValue,proto3,oneof"` +type ModuleSpec_Value_IntValue struct { + IntValue int64 `protobuf:"varint,12,opt,name=int_value,json=intValue,proto3,oneof"` } -func (*ModuleDescription_DescriptionValue_StringValue) isModuleDescription_DescriptionValue_Value() {} +type ModuleSpec_Value_DoubleValue struct { + DoubleValue float64 `protobuf:"fixed64,13,opt,name=double_value,json=doubleValue,proto3,oneof"` +} -func (*ModuleDescription_DescriptionValue_IntValue) isModuleDescription_DescriptionValue_Value() {} +type ModuleSpec_Value_BoolValue struct { + BoolValue bool `protobuf:"varint,14,opt,name=bool_value,json=boolValue,proto3,oneof"` +} -func (*ModuleDescription_DescriptionValue_DoubleValue) isModuleDescription_DescriptionValue_Value() {} +func (*ModuleSpec_Value_StringValue) isModuleSpec_Value_SingleValue() {} -func (*ModuleDescription_DescriptionValue_BoolValue) isModuleDescription_DescriptionValue_Value() {} +func (*ModuleSpec_Value_IntValue) isModuleSpec_Value_SingleValue() {} -func (*ModuleDescription_DescriptionValue_NestedValue) isModuleDescription_DescriptionValue_Value() {} +func (*ModuleSpec_Value_DoubleValue) isModuleSpec_Value_SingleValue() {} + +func (*ModuleSpec_Value_BoolValue) isModuleSpec_Value_SingleValue() {} var File_rpc_v1_spec_proto protoreflect.FileDescriptor var file_rpc_v1_spec_proto_rawDesc = []byte{ 0x0a, 0x11, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x76, 0x31, 0x22, 0xd0, 0x03, 0x0a, 0x11, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, - 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x60, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x76, 0x31, 0x22, 0x74, 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x40, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, + 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, + 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, + 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0xf0, 0x08, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x33, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, + 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, + 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x3d, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x25, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, + 0xd7, 0x04, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, + 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, + 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x23, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x04, 0x6b, 0x69, 0x6e, 0x64, 0x12, 0x56, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0a, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, + 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, + 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, + 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, + 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, 0x0a, + 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x15, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x16, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x18, 0x20, 0x03, 0x28, 0x08, 0x52, 0x0a, 0x62, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x1a, 0x60, 0x0a, 0x11, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x78, 0x56, 0x61, 0x6c, 0x75, 0x65, 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, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x52, 0x11, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x73, 0x1a, 0x8f, 0x02, 0x0a, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x0c, 0x73, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x48, 0x00, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x23, - 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, - 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x07, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3d, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x61, 0x64, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x64, 0x72, 0x6f, 0x70, 0x22, 0x61, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x42, 0x69, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, - 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x5e, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, - 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x78, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x6e, 0x6f, 0x5f, 0x63, - 0x6f, 0x70, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6e, 0x6f, 0x43, 0x6f, 0x70, - 0x79, 0x22, 0xf8, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, - 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, - 0x0a, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, 0x64, 0x12, 0x48, 0x0a, - 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x43, 0x61, 0x70, - 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x0d, 0x76, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x52, 0x0c, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x12, 0x45, 0x0a, 0x0c, 0x74, 0x6d, 0x70, 0x66, 0x73, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, - 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0b, 0x74, 0x6d, 0x70, - 0x66, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x62, 0x69, 0x6e, 0x64, - 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x69, 0x6e, + 0x67, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x5a, 0x0a, 0x0b, 0x56, 0x61, 0x6c, + 0x75, 0x65, 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, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x53, 0x70, 0x65, 0x63, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x61, 0x0a, 0x09, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4b, 0x69, + 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x55, + 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x10, 0x01, + 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4b, 0x69, 0x6e, 0x64, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4b, 0x69, 0x6e, + 0x64, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x10, 0x04, 0x22, 0xc0, 0x01, 0x0a, 0x09, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x10, + 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x4d, 0x61, 0x70, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x69, 0x63, 0x65, + 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x49, + 0x6e, 0x74, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x6c, 0x69, 0x63, + 0x65, 0x10, 0x06, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x6f, 0x6f, 0x6c, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x10, 0x07, 0x22, 0x3d, 0x0a, 0x15, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x69, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x64, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x03, 0x61, 0x64, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x64, 0x72, 0x6f, 0x70, 0x22, 0x61, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x69, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x6e, 0x74, - 0x52, 0x0a, 0x62, 0x69, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0xe8, 0x02, 0x0a, - 0x08, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4f, 0x0a, 0x12, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, - 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, 0x0d, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x2e, 0x49, 0x6e, 0x70, 0x75, - 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x3a, 0x0a, 0x09, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x52, 0x09, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x44, 0x69, 0x72, 0x1a, 0x3f, 0x0a, 0x11, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4d, - 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 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, 0x2a, 0x6b, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, + 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x5e, 0x0a, + 0x13, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4d, + 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22, 0x78, 0x0a, + 0x14, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x17, + 0x0a, 0x07, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x6e, 0x6f, 0x43, 0x6f, 0x70, 0x79, 0x22, 0xf8, 0x02, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, 0x67, 0x65, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x69, 0x6c, 0x65, + 0x67, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x43, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, + 0x0c, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x48, 0x0a, + 0x0d, 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x6f, + 0x6c, 0x75, 0x6d, 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0c, 0x76, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x0a, 0x0c, 0x74, 0x6d, 0x70, 0x66, 0x73, + 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x54, 0x6d, 0x70, 0x66, 0x73, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x52, 0x0b, 0x74, 0x6d, 0x70, 0x66, 0x73, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x42, + 0x0a, 0x0b, 0x62, 0x69, 0x6e, 0x64, 0x5f, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x42, 0x69, 0x6e, + 0x64, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x0a, 0x62, 0x69, 0x6e, 0x64, 0x4d, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x12, + 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x3a, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, + 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, + 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3a, 0x0a, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x70, 0x65, 0x63, 0x52, 0x09, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x44, 0x69, 0x72, 0x2a, 0x6b, 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x54, 0x6f, 0x6f, 0x6c, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x61, @@ -833,36 +1069,44 @@ func file_rpc_v1_spec_proto_rawDescGZIP() []byte { return file_rpc_v1_spec_proto_rawDescData } -var file_rpc_v1_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_rpc_v1_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_rpc_v1_spec_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_rpc_v1_spec_proto_msgTypes = make([]protoimpl.MessageInfo, 11) var file_rpc_v1_spec_proto_goTypes = []interface{}{ - (Category)(0), // 0: buildr.rpc.v1.Category - (*ModuleDescription)(nil), // 1: buildr.rpc.v1.ModuleDescription - (*ContainerCapabilities)(nil), // 2: buildr.rpc.v1.ContainerCapabilities - (*ContainerBindMount)(nil), // 3: buildr.rpc.v1.ContainerBindMount - (*ContainerTmpfsMount)(nil), // 4: buildr.rpc.v1.ContainerTmpfsMount - (*ContainerVolumeMount)(nil), // 5: buildr.rpc.v1.ContainerVolumeMount - (*ContainerSpec)(nil), // 6: buildr.rpc.v1.ContainerSpec - (*TaskSpec)(nil), // 7: buildr.rpc.v1.TaskSpec - (*ModuleDescription_DescriptionValue)(nil), // 8: buildr.rpc.v1.ModuleDescription.DescriptionValue - nil, // 9: buildr.rpc.v1.TaskSpec.InputMappingEntry + (Category)(0), // 0: buildr.rpc.v1.Category + (ModuleSpec_ValueKind)(0), // 1: buildr.rpc.v1.ModuleSpec.ValueKind + (ModuleSpec_ValueType)(0), // 2: buildr.rpc.v1.ModuleSpec.ValueType + (*ModuleReference)(nil), // 3: buildr.rpc.v1.ModuleReference + (*ModuleSpec)(nil), // 4: buildr.rpc.v1.ModuleSpec + (*ContainerCapabilities)(nil), // 5: buildr.rpc.v1.ContainerCapabilities + (*ContainerBindMount)(nil), // 6: buildr.rpc.v1.ContainerBindMount + (*ContainerTmpfsMount)(nil), // 7: buildr.rpc.v1.ContainerTmpfsMount + (*ContainerVolumeMount)(nil), // 8: buildr.rpc.v1.ContainerVolumeMount + (*ContainerSpec)(nil), // 9: buildr.rpc.v1.ContainerSpec + (*TaskSpec)(nil), // 10: buildr.rpc.v1.TaskSpec + (*ModuleSpec_Value)(nil), // 11: buildr.rpc.v1.ModuleSpec.Value + nil, // 12: buildr.rpc.v1.ModuleSpec.ValuesEntry + nil, // 13: buildr.rpc.v1.ModuleSpec.Value.ComplexValueEntry } var file_rpc_v1_spec_proto_depIdxs = []int32{ - 0, // 0: buildr.rpc.v1.ModuleDescription.category:type_name -> buildr.rpc.v1.Category - 8, // 1: buildr.rpc.v1.ModuleDescription.description_values:type_name -> buildr.rpc.v1.ModuleDescription.DescriptionValue - 2, // 2: buildr.rpc.v1.ContainerSpec.capabilities:type_name -> buildr.rpc.v1.ContainerCapabilities - 5, // 3: buildr.rpc.v1.ContainerSpec.volume_mounts:type_name -> buildr.rpc.v1.ContainerVolumeMount - 4, // 4: buildr.rpc.v1.ContainerSpec.tmpfs_mounts:type_name -> buildr.rpc.v1.ContainerTmpfsMount - 3, // 5: buildr.rpc.v1.ContainerSpec.bind_mounts:type_name -> buildr.rpc.v1.ContainerBindMount - 1, // 6: buildr.rpc.v1.TaskSpec.module_description:type_name -> buildr.rpc.v1.ModuleDescription - 9, // 7: buildr.rpc.v1.TaskSpec.input_mapping:type_name -> buildr.rpc.v1.TaskSpec.InputMappingEntry - 6, // 8: buildr.rpc.v1.TaskSpec.container:type_name -> buildr.rpc.v1.ContainerSpec - 8, // 9: buildr.rpc.v1.ModuleDescription.DescriptionValue.nested_value:type_name -> buildr.rpc.v1.ModuleDescription.DescriptionValue - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 0, // 0: buildr.rpc.v1.ModuleReference.module_category:type_name -> buildr.rpc.v1.Category + 0, // 1: buildr.rpc.v1.ModuleSpec.category:type_name -> buildr.rpc.v1.Category + 12, // 2: buildr.rpc.v1.ModuleSpec.values:type_name -> buildr.rpc.v1.ModuleSpec.ValuesEntry + 5, // 3: buildr.rpc.v1.ContainerSpec.capabilities:type_name -> buildr.rpc.v1.ContainerCapabilities + 8, // 4: buildr.rpc.v1.ContainerSpec.volume_mounts:type_name -> buildr.rpc.v1.ContainerVolumeMount + 7, // 5: buildr.rpc.v1.ContainerSpec.tmpfs_mounts:type_name -> buildr.rpc.v1.ContainerTmpfsMount + 6, // 6: buildr.rpc.v1.ContainerSpec.bind_mounts:type_name -> buildr.rpc.v1.ContainerBindMount + 4, // 7: buildr.rpc.v1.TaskSpec.module_spec:type_name -> buildr.rpc.v1.ModuleSpec + 9, // 8: buildr.rpc.v1.TaskSpec.container:type_name -> buildr.rpc.v1.ContainerSpec + 2, // 9: buildr.rpc.v1.ModuleSpec.Value.type:type_name -> buildr.rpc.v1.ModuleSpec.ValueType + 1, // 10: buildr.rpc.v1.ModuleSpec.Value.kind:type_name -> buildr.rpc.v1.ModuleSpec.ValueKind + 13, // 11: buildr.rpc.v1.ModuleSpec.Value.complex_value:type_name -> buildr.rpc.v1.ModuleSpec.Value.ComplexValueEntry + 11, // 12: buildr.rpc.v1.ModuleSpec.ValuesEntry.value:type_name -> buildr.rpc.v1.ModuleSpec.Value + 11, // 13: buildr.rpc.v1.ModuleSpec.Value.ComplexValueEntry.value:type_name -> buildr.rpc.v1.ModuleSpec.Value + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_rpc_v1_spec_proto_init() } @@ -872,7 +1116,7 @@ func file_rpc_v1_spec_proto_init() { } if !protoimpl.UnsafeEnabled { file_rpc_v1_spec_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleDescription); i { + switch v := v.(*ModuleReference); i { case 0: return &v.state case 1: @@ -884,7 +1128,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerCapabilities); i { + switch v := v.(*ModuleSpec); i { case 0: return &v.state case 1: @@ -896,7 +1140,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerBindMount); i { + switch v := v.(*ContainerCapabilities); i { case 0: return &v.state case 1: @@ -908,7 +1152,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerTmpfsMount); i { + switch v := v.(*ContainerBindMount); i { case 0: return &v.state case 1: @@ -920,7 +1164,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerVolumeMount); i { + switch v := v.(*ContainerTmpfsMount); i { case 0: return &v.state case 1: @@ -932,7 +1176,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerSpec); i { + switch v := v.(*ContainerVolumeMount); i { case 0: return &v.state case 1: @@ -944,7 +1188,7 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TaskSpec); i { + switch v := v.(*ContainerSpec); i { case 0: return &v.state case 1: @@ -956,7 +1200,19 @@ func file_rpc_v1_spec_proto_init() { } } file_rpc_v1_spec_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleDescription_DescriptionValue); i { + switch v := v.(*TaskSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_v1_spec_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ModuleSpec_Value); i { case 0: return &v.state case 1: @@ -968,20 +1224,19 @@ func file_rpc_v1_spec_proto_init() { } } } - file_rpc_v1_spec_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*ModuleDescription_DescriptionValue_StringValue)(nil), - (*ModuleDescription_DescriptionValue_IntValue)(nil), - (*ModuleDescription_DescriptionValue_DoubleValue)(nil), - (*ModuleDescription_DescriptionValue_BoolValue)(nil), - (*ModuleDescription_DescriptionValue_NestedValue)(nil), + file_rpc_v1_spec_proto_msgTypes[8].OneofWrappers = []interface{}{ + (*ModuleSpec_Value_StringValue)(nil), + (*ModuleSpec_Value_IntValue)(nil), + (*ModuleSpec_Value_DoubleValue)(nil), + (*ModuleSpec_Value_BoolValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rpc_v1_spec_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, + NumEnums: 3, + NumMessages: 11, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/generated/rpc/v1/spec_vtproto.pb.go b/protocol/generated/rpc/v1/spec_vtproto.pb.go index b07d67d..275d8f5 100644 --- a/protocol/generated/rpc/v1/spec_vtproto.pb.go +++ b/protocol/generated/rpc/v1/spec_vtproto.pb.go @@ -20,7 +20,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -func (m *ModuleDescription_DescriptionValue) MarshalVT() (dAtA []byte, err error) { +func (m *ModuleReference) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -33,12 +33,12 @@ func (m *ModuleDescription_DescriptionValue) MarshalVT() (dAtA []byte, err error return dAtA[:n], nil } -func (m *ModuleDescription_DescriptionValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleReference) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription_DescriptionValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleReference) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -50,7 +50,52 @@ func (m *ModuleDescription_DescriptionValue) MarshalToSizedBufferVT(dAtA []byte) i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if vtmsg, ok := m.Value.(interface { + if len(m.ModuleType) > 0 { + i -= len(m.ModuleType) + copy(dAtA[i:], m.ModuleType) + i = encodeVarint(dAtA, i, uint64(len(m.ModuleType))) + i-- + dAtA[i] = 0x12 + } + if m.ModuleCategory != 0 { + i = encodeVarint(dAtA, i, uint64(m.ModuleCategory)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ModuleSpec_Value) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ModuleSpec_Value) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *ModuleSpec_Value) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if vtmsg, ok := m.SingleValue.(interface { MarshalToSizedBufferVT([]byte) (int, error) }); ok { size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) @@ -59,61 +104,147 @@ func (m *ModuleDescription_DescriptionValue) MarshalToSizedBufferVT(dAtA []byte) } i -= size } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarint(dAtA, i, uint64(len(m.Key))) + if len(m.BoolValues) > 0 { + for iNdEx := len(m.BoolValues) - 1; iNdEx >= 0; iNdEx-- { + i-- + if m.BoolValues[iNdEx] { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + } + i = encodeVarint(dAtA, i, uint64(len(m.BoolValues))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xc2 + } + if len(m.DoubleValues) > 0 { + for iNdEx := len(m.DoubleValues) - 1; iNdEx >= 0; iNdEx-- { + f1 := math.Float64bits(float64(m.DoubleValues[iNdEx])) + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(f1)) + } + i = encodeVarint(dAtA, i, uint64(len(m.DoubleValues)*8)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + if len(m.IntValues) > 0 { + var pksize3 int + for _, num := range m.IntValues { + pksize3 += sov(uint64(num)) + } + i -= pksize3 + j2 := i + for _, num1 := range m.IntValues { + num := uint64(num1) + for num >= 1<<7 { + dAtA[j2] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j2++ + } + dAtA[j2] = uint8(num) + j2++ + } + i = encodeVarint(dAtA, i, uint64(pksize3)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xb2 + } + if len(m.StringValues) > 0 { + for iNdEx := len(m.StringValues) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.StringValues[iNdEx]) + copy(dAtA[i:], m.StringValues[iNdEx]) + i = encodeVarint(dAtA, i, uint64(len(m.StringValues[iNdEx]))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa + } + } + if len(m.ComplexValue) > 0 { + for k := range m.ComplexValue { + v := m.ComplexValue[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x52 + } + } + if m.Kind != 0 { + i = encodeVarint(dAtA, i, uint64(m.Kind)) + i-- + dAtA[i] = 0x10 + } + if m.Type != 0 { + i = encodeVarint(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *ModuleDescription_DescriptionValue_StringValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_StringValue) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription_DescriptionValue_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_StringValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= len(m.StringValue) copy(dAtA[i:], m.StringValue) i = encodeVarint(dAtA, i, uint64(len(m.StringValue))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x5a return len(dAtA) - i, nil } -func (m *ModuleDescription_DescriptionValue_IntValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_IntValue) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription_DescriptionValue_IntValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_IntValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i = encodeVarint(dAtA, i, uint64(m.IntValue)) i-- - dAtA[i] = 0x18 + dAtA[i] = 0x60 return len(dAtA) - i, nil } -func (m *ModuleDescription_DescriptionValue_DoubleValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_DoubleValue) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription_DescriptionValue_DoubleValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_DoubleValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i -= 8 binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DoubleValue)))) i-- - dAtA[i] = 0x21 + dAtA[i] = 0x69 return len(dAtA) - i, nil } -func (m *ModuleDescription_DescriptionValue_BoolValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_BoolValue) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription_DescriptionValue_BoolValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleSpec_Value_BoolValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i := len(dAtA) i-- if m.BoolValue { @@ -122,29 +253,10 @@ func (m *ModuleDescription_DescriptionValue_BoolValue) MarshalToSizedBufferVT(dA dAtA[i] = 0 } i-- - dAtA[i] = 0x28 + dAtA[i] = 0x70 return len(dAtA) - i, nil } -func (m *ModuleDescription_DescriptionValue_NestedValue) MarshalToVT(dAtA []byte) (int, error) { - size := m.SizeVT() - return m.MarshalToSizedBufferVT(dAtA[:size]) -} - -func (m *ModuleDescription_DescriptionValue_NestedValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NestedValue != nil { - size, err := m.NestedValue.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} -func (m *ModuleDescription) MarshalVT() (dAtA []byte, err error) { +func (m *ModuleSpec) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -157,12 +269,12 @@ func (m *ModuleDescription) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ModuleDescription) MarshalToVT(dAtA []byte) (int, error) { +func (m *ModuleSpec) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ModuleDescription) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ModuleSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -174,15 +286,25 @@ func (m *ModuleDescription) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.DescriptionValues) > 0 { - for iNdEx := len(m.DescriptionValues) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.DescriptionValues[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if len(m.Values) > 0 { + for k := range m.Values { + v := m.Values[k] + baseI := i + size, err := v.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarint(dAtA, i, uint64(size)) i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarint(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarint(dAtA, i, uint64(baseI-i)) + i-- dAtA[i] = 0x1a } } @@ -569,7 +691,7 @@ func (m *TaskSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.OutputDir) i = encodeVarint(dAtA, i, uint64(len(m.OutputDir))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if m.Container != nil { size, err := m.Container.MarshalToSizedBufferVT(dAtA[:i]) @@ -579,29 +701,10 @@ func (m *TaskSpec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= size i = encodeVarint(dAtA, i, uint64(size)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } - if len(m.InputMapping) > 0 { - for k := range m.InputMapping { - v := m.InputMapping[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if m.ModuleDescription != nil { - size, err := m.ModuleDescription.MarshalToSizedBufferVT(dAtA[:i]) + if m.ModuleSpec != nil { + size, err := m.ModuleSpec.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { return 0, err } @@ -631,24 +734,75 @@ func encodeVarint(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *ModuleDescription_DescriptionValue) SizeVT() (n int) { +func (m *ModuleReference) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Key) + if m.ModuleCategory != 0 { + n += 1 + sov(uint64(m.ModuleCategory)) + } + l = len(m.ModuleType) if l > 0 { n += 1 + l + sov(uint64(l)) } - if vtmsg, ok := m.Value.(interface{ SizeVT() int }); ok { - n += vtmsg.SizeVT() - } n += len(m.unknownFields) return n } -func (m *ModuleDescription_DescriptionValue_StringValue) SizeVT() (n int) { +func (m *ModuleSpec_Value) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Type != 0 { + n += 1 + sov(uint64(m.Type)) + } + if m.Kind != 0 { + n += 1 + sov(uint64(m.Kind)) + } + if len(m.ComplexValue) > 0 { + for k, v := range m.ComplexValue { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + } + } + if vtmsg, ok := m.SingleValue.(interface{ SizeVT() int }); ok { + n += vtmsg.SizeVT() + } + if len(m.StringValues) > 0 { + for _, s := range m.StringValues { + l = len(s) + n += 2 + l + sov(uint64(l)) + } + } + if len(m.IntValues) > 0 { + l = 0 + for _, e := range m.IntValues { + l += sov(uint64(e)) + } + n += 2 + sov(uint64(l)) + l + } + if len(m.DoubleValues) > 0 { + n += 2 + sov(uint64(len(m.DoubleValues)*8)) + len(m.DoubleValues)*8 + } + if len(m.BoolValues) > 0 { + n += 2 + sov(uint64(len(m.BoolValues))) + len(m.BoolValues)*1 + } + n += len(m.unknownFields) + return n +} + +func (m *ModuleSpec_Value_StringValue) SizeVT() (n int) { if m == nil { return 0 } @@ -658,7 +812,7 @@ func (m *ModuleDescription_DescriptionValue_StringValue) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) return n } -func (m *ModuleDescription_DescriptionValue_IntValue) SizeVT() (n int) { +func (m *ModuleSpec_Value_IntValue) SizeVT() (n int) { if m == nil { return 0 } @@ -667,7 +821,7 @@ func (m *ModuleDescription_DescriptionValue_IntValue) SizeVT() (n int) { n += 1 + sov(uint64(m.IntValue)) return n } -func (m *ModuleDescription_DescriptionValue_DoubleValue) SizeVT() (n int) { +func (m *ModuleSpec_Value_DoubleValue) SizeVT() (n int) { if m == nil { return 0 } @@ -676,7 +830,7 @@ func (m *ModuleDescription_DescriptionValue_DoubleValue) SizeVT() (n int) { n += 9 return n } -func (m *ModuleDescription_DescriptionValue_BoolValue) SizeVT() (n int) { +func (m *ModuleSpec_Value_BoolValue) SizeVT() (n int) { if m == nil { return 0 } @@ -685,19 +839,7 @@ func (m *ModuleDescription_DescriptionValue_BoolValue) SizeVT() (n int) { n += 2 return n } -func (m *ModuleDescription_DescriptionValue_NestedValue) SizeVT() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NestedValue != nil { - l = m.NestedValue.SizeVT() - n += 1 + l + sov(uint64(l)) - } - return n -} -func (m *ModuleDescription) SizeVT() (n int) { +func (m *ModuleSpec) SizeVT() (n int) { if m == nil { return 0 } @@ -710,10 +852,17 @@ func (m *ModuleDescription) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if len(m.DescriptionValues) > 0 { - for _, e := range m.DescriptionValues { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + if len(m.Values) > 0 { + for k, v := range m.Values { + _ = k + _ = v + l = 0 + if v != nil { + l = v.SizeVT() + } + l += 1 + sov(uint64(l)) + mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l + n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) } } n += len(m.unknownFields) @@ -860,18 +1009,10 @@ func (m *TaskSpec) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.ModuleDescription != nil { - l = m.ModuleDescription.SizeVT() + if m.ModuleSpec != nil { + l = m.ModuleSpec.SizeVT() n += 1 + l + sov(uint64(l)) } - if len(m.InputMapping) > 0 { - for k, v := range m.InputMapping { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) - } - } if m.Container != nil { l = m.Container.SizeVT() n += 1 + l + sov(uint64(l)) @@ -890,7 +1031,7 @@ func sov(x uint64) (n int) { func soz(x uint64) (n int) { return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { +func (m *ModuleReference) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -913,15 +1054,34 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModuleDescription_DescriptionValue: wiretype end group for non-group") + return fmt.Errorf("proto: ModuleReference: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModuleDescription_DescriptionValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModuleReference: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleCategory", wireType) + } + m.ModuleCategory = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ModuleCategory |= Category(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ModuleType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -949,9 +1109,227 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Key = string(dAtA[iNdEx:postIndex]) + m.ModuleType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ModuleSpec_Value) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ModuleSpec_Value: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ModuleSpec_Value: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= ModuleSpec_ValueType(b&0x7F) << shift + if b < 0x80 { + break + } + } case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + m.Kind = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Kind |= ModuleSpec_ValueKind(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ComplexValue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ComplexValue == nil { + m.ComplexValue = make(map[string]*ModuleSpec_Value) + } + var mapkey string + var mapvalue *ModuleSpec_Value + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ModuleSpec_Value{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.ComplexValue[mapkey] = mapvalue + iNdEx = postIndex + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field StringValue", wireType) } @@ -981,9 +1359,9 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = &ModuleDescription_DescriptionValue_StringValue{StringValue: string(dAtA[iNdEx:postIndex])} + m.SingleValue = &ModuleSpec_Value_StringValue{StringValue: string(dAtA[iNdEx:postIndex])} iNdEx = postIndex - case 3: + case 12: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IntValue", wireType) } @@ -1002,8 +1380,8 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { break } } - m.Value = &ModuleDescription_DescriptionValue_IntValue{IntValue: v} - case 4: + m.SingleValue = &ModuleSpec_Value_IntValue{IntValue: v} + case 13: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field DoubleValue", wireType) } @@ -1013,8 +1391,8 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { } v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - m.Value = &ModuleDescription_DescriptionValue_DoubleValue{DoubleValue: float64(math.Float64frombits(v))} - case 5: + m.SingleValue = &ModuleSpec_Value_DoubleValue{DoubleValue: float64(math.Float64frombits(v))} + case 14: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BoolValue", wireType) } @@ -1034,12 +1412,12 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { } } b := bool(v != 0) - m.Value = &ModuleDescription_DescriptionValue_BoolValue{BoolValue: b} - case 6: + m.SingleValue = &ModuleSpec_Value_BoolValue{BoolValue: b} + case 21: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NestedValue", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field StringValues", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -1049,33 +1427,224 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if oneof, ok := m.Value.(*ModuleDescription_DescriptionValue_NestedValue); ok { - if err := oneof.NestedValue.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.StringValues = append(m.StringValues, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 22: + if wireType == 0 { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IntValues = append(m.IntValues, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.IntValues) == 0 { + m.IntValues = make([]int64, 0, elementCount) + } + for iNdEx < postIndex { + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IntValues = append(m.IntValues, v) } } else { - v := &ModuleDescription_DescriptionValue{} - if err := v.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &ModuleDescription_DescriptionValue_NestedValue{NestedValue: v} + return fmt.Errorf("proto: wrong wireType = %d for field IntValues", wireType) + } + case 23: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.DoubleValues = append(m.DoubleValues, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.DoubleValues) == 0 { + m.DoubleValues = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.DoubleValues = append(m.DoubleValues, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field DoubleValues", wireType) + } + case 24: + if wireType == 0 { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BoolValues = append(m.BoolValues, bool(v != 0)) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen + if elementCount != 0 && len(m.BoolValues) == 0 { + m.BoolValues = make([]bool, 0, elementCount) + } + for iNdEx < postIndex { + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BoolValues = append(m.BoolValues, bool(v != 0)) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BoolValues", wireType) } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -1098,7 +1667,7 @@ func (m *ModuleDescription_DescriptionValue) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ModuleDescription) UnmarshalVT(dAtA []byte) error { +func (m *ModuleSpec) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1121,10 +1690,10 @@ func (m *ModuleDescription) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ModuleDescription: wiretype end group for non-group") + return fmt.Errorf("proto: ModuleSpec: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ModuleDescription: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ModuleSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1180,7 +1749,7 @@ func (m *ModuleDescription) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DescriptionValues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1207,10 +1776,105 @@ func (m *ModuleDescription) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.DescriptionValues = append(m.DescriptionValues, &ModuleDescription_DescriptionValue{}) - if err := m.DescriptionValues[len(m.DescriptionValues)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + if m.Values == nil { + m.Values = make(map[string]*ModuleSpec_Value) } + var mapkey string + var mapvalue *ModuleSpec_Value + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLength + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLength + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLength + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLength + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ModuleSpec_Value{} + if err := mapvalue.UnmarshalVT(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Values[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -2097,7 +2761,7 @@ func (m *TaskSpec) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ModuleDescription", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ModuleSpec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2124,141 +2788,14 @@ func (m *TaskSpec) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ModuleDescription == nil { - m.ModuleDescription = &ModuleDescription{} + if m.ModuleSpec == nil { + m.ModuleSpec = &ModuleSpec{} } - if err := m.ModuleDescription.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ModuleSpec.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InputMapping", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.InputMapping == nil { - m.InputMapping = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLength - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLength - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLength - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLength - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.InputMapping[mapkey] = mapvalue - iNdEx = postIndex - case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Container", wireType) } @@ -2294,7 +2831,7 @@ func (m *TaskSpec) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OutputDir", wireType) } diff --git a/protocol/generated/rpc/v1/wasi.pb.go b/protocol/generated/rpc/v1/wasi.pb.go index e2092bd..5772c82 100644 --- a/protocol/generated/rpc/v1/wasi.pb.go +++ b/protocol/generated/rpc/v1/wasi.pb.go @@ -264,55 +264,250 @@ func (x *LookupPathResponse) GetError() string { return "" } +type HelpRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ModuleReference *ModuleReference `protobuf:"bytes,1,opt,name=module_reference,json=moduleReference,proto3" json:"module_reference,omitempty"` +} + +func (x *HelpRequest) Reset() { + *x = HelpRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_v1_wasi_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelpRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelpRequest) ProtoMessage() {} + +func (x *HelpRequest) ProtoReflect() protoreflect.Message { + mi := &file_rpc_v1_wasi_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 HelpRequest.ProtoReflect.Descriptor instead. +func (*HelpRequest) Descriptor() ([]byte, []int) { + return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{4} +} + +func (x *HelpRequest) GetModuleReference() *ModuleReference { + if x != nil { + return x.ModuleReference + } + return nil +} + +type TaskExample struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + TaskSpec *TaskSpec `protobuf:"bytes,3,opt,name=task_spec,json=taskSpec,proto3" json:"task_spec,omitempty"` +} + +func (x *TaskExample) Reset() { + *x = TaskExample{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_v1_wasi_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TaskExample) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskExample) ProtoMessage() {} + +func (x *TaskExample) ProtoReflect() protoreflect.Message { + mi := &file_rpc_v1_wasi_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 TaskExample.ProtoReflect.Descriptor instead. +func (*TaskExample) Descriptor() ([]byte, []int) { + return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{5} +} + +func (x *TaskExample) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *TaskExample) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *TaskExample) GetTaskSpec() *TaskSpec { + if x != nil { + return x.TaskSpec + } + return nil +} + +type HelpResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Examples []*TaskExample `protobuf:"bytes,3,rep,name=examples,proto3" json:"examples,omitempty"` +} + +func (x *HelpResponse) Reset() { + *x = HelpResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_rpc_v1_wasi_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HelpResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HelpResponse) ProtoMessage() {} + +func (x *HelpResponse) ProtoReflect() protoreflect.Message { + mi := &file_rpc_v1_wasi_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 HelpResponse.ProtoReflect.Descriptor instead. +func (*HelpResponse) Descriptor() ([]byte, []int) { + return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{6} +} + +func (x *HelpResponse) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *HelpResponse) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *HelpResponse) GetExamples() []*TaskExample { + if x != nil { + return x.Examples + } + return nil +} + var File_rpc_v1_wasi_proto protoreflect.FileDescriptor var file_rpc_v1_wasi_proto_rawDesc = []byte{ 0x0a, 0x11, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, - 0x76, 0x31, 0x22, 0x9d, 0x02, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x77, 0x6f, 0x72, 0x6b, - 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x72, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x55, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, - 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, - 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x73, 0x74, 0x64, - 0x69, 0x6e, 0x1a, 0x3e, 0x0a, 0x10, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, - 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x22, 0x61, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x61, - 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x78, - 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, - 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, - 0x74, 0x64, 0x65, 0x72, 0x72, 0x22, 0x2d, 0x0a, 0x11, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, - 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x3e, 0x0a, 0x12, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x61, - 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x14, - 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x42, 0xb5, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x09, 0x57, 0x61, 0x73, 0x69, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, - 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, - 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, - 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, - 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x52, 0x58, 0xaa, 0x02, - 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x42, 0x75, 0x69, - 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x31, 0x1a, 0x11, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9d, 0x02, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x77, + 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x55, 0x0a, 0x0b, 0x65, 0x6e, 0x76, 0x69, + 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, + 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0b, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, + 0x73, 0x74, 0x64, 0x69, 0x6e, 0x1a, 0x3e, 0x0a, 0x10, 0x45, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x61, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, + 0x09, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x22, 0x2d, 0x0a, 0x11, 0x4c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x22, 0x3e, 0x0a, 0x12, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x50, 0x61, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x58, 0x0a, 0x0b, 0x48, 0x65, 0x6c, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x22, 0x79, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 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, 0x34, 0x0a, 0x09, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x62, 0x75, 0x69, 0x6c, + 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x53, 0x70, + 0x65, 0x63, 0x52, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x53, 0x70, 0x65, 0x63, 0x22, 0x7c, 0x0a, 0x0c, + 0x48, 0x65, 0x6c, 0x70, 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, 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, 0x36, 0x0a, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, + 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x52, 0x08, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x42, 0xb5, 0x01, 0x0a, 0x11, 0x63, + 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, + 0x42, 0x09, 0x57, 0x61, 0x73, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3f, 0x63, + 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f, 0x62, + 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2d, 0x67, 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x42, 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x70, + 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, + 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x70, + 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -327,21 +522,29 @@ func file_rpc_v1_wasi_proto_rawDescGZIP() []byte { return file_rpc_v1_wasi_proto_rawDescData } -var file_rpc_v1_wasi_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_rpc_v1_wasi_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_rpc_v1_wasi_proto_goTypes = []interface{}{ (*ProcessStartRequest)(nil), // 0: buildr.rpc.v1.ProcessStartRequest (*ProcessStartResponse)(nil), // 1: buildr.rpc.v1.ProcessStartResponse (*LookupPathRequest)(nil), // 2: buildr.rpc.v1.LookupPathRequest (*LookupPathResponse)(nil), // 3: buildr.rpc.v1.LookupPathResponse - nil, // 4: buildr.rpc.v1.ProcessStartRequest.EnvironmentEntry + (*HelpRequest)(nil), // 4: buildr.rpc.v1.HelpRequest + (*TaskExample)(nil), // 5: buildr.rpc.v1.TaskExample + (*HelpResponse)(nil), // 6: buildr.rpc.v1.HelpResponse + nil, // 7: buildr.rpc.v1.ProcessStartRequest.EnvironmentEntry + (*ModuleReference)(nil), // 8: buildr.rpc.v1.ModuleReference + (*TaskSpec)(nil), // 9: buildr.rpc.v1.TaskSpec } var file_rpc_v1_wasi_proto_depIdxs = []int32{ - 4, // 0: buildr.rpc.v1.ProcessStartRequest.environment:type_name -> buildr.rpc.v1.ProcessStartRequest.EnvironmentEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 7, // 0: buildr.rpc.v1.ProcessStartRequest.environment:type_name -> buildr.rpc.v1.ProcessStartRequest.EnvironmentEntry + 8, // 1: buildr.rpc.v1.HelpRequest.module_reference:type_name -> buildr.rpc.v1.ModuleReference + 9, // 2: buildr.rpc.v1.TaskExample.task_spec:type_name -> buildr.rpc.v1.TaskSpec + 5, // 3: buildr.rpc.v1.HelpResponse.examples:type_name -> buildr.rpc.v1.TaskExample + 4, // [4:4] is the sub-list for method output_type + 4, // [4:4] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_rpc_v1_wasi_proto_init() } @@ -349,6 +552,7 @@ func file_rpc_v1_wasi_proto_init() { if File_rpc_v1_wasi_proto != nil { return } + file_rpc_v1_spec_proto_init() if !protoimpl.UnsafeEnabled { file_rpc_v1_wasi_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProcessStartRequest); i { @@ -398,6 +602,42 @@ func file_rpc_v1_wasi_proto_init() { return nil } } + file_rpc_v1_wasi_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelpRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_v1_wasi_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TaskExample); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_rpc_v1_wasi_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HelpResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -405,7 +645,7 @@ func file_rpc_v1_wasi_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_rpc_v1_wasi_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 8, NumExtensions: 0, NumServices: 0, }, diff --git a/protocol/generated/rpc/v1/wasi_vtproto.pb.go b/protocol/generated/rpc/v1/wasi_vtproto.pb.go index 546db49..26429b5 100644 --- a/protocol/generated/rpc/v1/wasi_vtproto.pb.go +++ b/protocol/generated/rpc/v1/wasi_vtproto.pb.go @@ -238,6 +238,165 @@ func (m *LookupPathResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *HelpRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HelpRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HelpRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ModuleReference != nil { + size, err := m.ModuleReference.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TaskExample) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TaskExample) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *TaskExample) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.TaskSpec != nil { + size, err := m.TaskSpec.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HelpResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HelpResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HelpResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Examples) > 0 { + for iNdEx := len(m.Examples) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Examples[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarint(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ProcessStartRequest) SizeVT() (n int) { if m == nil { return 0 @@ -327,6 +486,66 @@ func (m *LookupPathResponse) SizeVT() (n int) { return n } +func (m *HelpRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ModuleReference != nil { + l = m.ModuleReference.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *TaskExample) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.TaskSpec != nil { + l = m.TaskSpec.SizeVT() + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HelpResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if len(m.Examples) > 0 { + for _, e := range m.Examples { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *ProcessStartRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -969,3 +1188,390 @@ func (m *LookupPathResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *HelpRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HelpRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HelpRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ModuleReference", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ModuleReference == nil { + m.ModuleReference = &ModuleReference{} + } + if err := m.ModuleReference.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TaskExample) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TaskExample: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TaskExample: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TaskSpec", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TaskSpec == nil { + m.TaskSpec = &TaskSpec{} + } + if err := m.TaskSpec.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HelpResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HelpResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HelpResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Examples", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Examples = append(m.Examples, &TaskExample{}) + if err := m.Examples[len(m.Examples)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/protocol/marshal.go b/protocol/marshal.go new file mode 100644 index 0000000..fcd5113 --- /dev/null +++ b/protocol/marshal.go @@ -0,0 +1,189 @@ +package protocol + +import ( + "errors" + "fmt" + "reflect" + + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" +) + +var ErrExpectedStruct = errors.New("expected struct") + +func Marshal(in any) (*rpcv1.ModuleSpec, error) { + val := reflect.ValueOf(in) + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + + if val.Kind() != reflect.Struct { + return nil, fmt.Errorf("%w: got %T", ErrExpectedStruct, in) + } + + return marshal(val) +} + +func marshal(in reflect.Value) (*rpcv1.ModuleSpec, error) { + numField := in.NumField() + + out := &rpcv1.ModuleSpec{ + Values: make(map[string]*rpcv1.ModuleSpec_Value, numField), + } + + inputType := in.Type() + + for i := 0; i < numField; i++ { + structField := inputType.Field(i) + if !structField.IsExported() { + continue + } + + out.Values[structField.Name] = mapReflectValueToSpecValue(in.Field(i)) + } + + return out, nil +} + +func mapReflectValueToSpecValue(in reflect.Value) *rpcv1.ModuleSpec_Value { + switch in.Kind() { + case reflect.Bool: + return boolValue(in.Bool()) + case reflect.String: + return stringValue(in.String()) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return intValue(in.Int()) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return intValue(in.Uint()) + case reflect.Float32, reflect.Float64: + return floatValue(in.Float()) + case reflect.Struct: + return structValue(in) + case reflect.Slice, reflect.Array: + switch in.Type().Elem().Kind() { + case reflect.Bool: + return boolSliceValue(in) + case reflect.String: + return stringSliceValue(in) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return intSliceValue(in, reflect.Value.Int) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return intSliceValue(in, func(v reflect.Value) int64 { + return int64(v.Uint()) + }) + case reflect.Float32, reflect.Float64: + return floatSliceValue(in) + default: + return nil + } + default: + return nil + } +} + +func structValue(in reflect.Value) *rpcv1.ModuleSpec_Value { + inputType := in.Type() + numFields := inputType.NumField() + result := &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeObject, + ComplexValue: make(map[string]*rpcv1.ModuleSpec_Value, numFields), + } + + for i := 0; i < numFields; i++ { + structField := inputType.Field(i) + if !structField.IsExported() { + continue + } + + result.ComplexValue[structField.Name] = mapReflectValueToSpecValue(in.Field(i)) + } + + return result +} + +func boolValue(in bool) *rpcv1.ModuleSpec_Value { + return &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_BoolValue{ + BoolValue: in, + }, + } +} + +func boolSliceValue(val reflect.Value) *rpcv1.ModuleSpec_Value { + result := &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeBoolSlice, + BoolValues: make([]bool, 0, val.Len()), + } + + for i := 0; i < val.Len(); i++ { + result.BoolValues = append(result.BoolValues, val.Index(i).Bool()) + } + + return result +} + +func intValue[T Integer](in T) *rpcv1.ModuleSpec_Value { + return &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_IntValue{ + IntValue: int64(in), + }, + } +} + +func intSliceValue(val reflect.Value, selector func(v reflect.Value) int64) *rpcv1.ModuleSpec_Value { + result := &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeIntSlice, + IntValues: make([]int64, 0, val.Len()), + } + + for i := 0; i < val.Len(); i++ { + result.IntValues = append(result.IntValues, selector(val.Index(i))) + } + + return result +} + +func floatValue[T Float](in T) *rpcv1.ModuleSpec_Value { + return &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_DoubleValue{ + DoubleValue: float64(in), + }, + } +} + +func floatSliceValue(val reflect.Value) *rpcv1.ModuleSpec_Value { + result := &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeIntSlice, + DoubleValues: make([]float64, 0, val.Len()), + } + + for i := 0; i < val.Len(); i++ { + result.DoubleValues = append(result.DoubleValues, val.Index(i).Float()) + } + + return result +} + +func stringValue(in string) *rpcv1.ModuleSpec_Value { + return &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: in, + }, + } +} + +func stringSliceValue(val reflect.Value) *rpcv1.ModuleSpec_Value { + result := &rpcv1.ModuleSpec_Value{ + Type: rpcv1.ModuleSpec_ValueTypeIntSlice, + StringValues: make([]string, 0, val.Len()), + } + + for i := 0; i < val.Len(); i++ { + result.StringValues = append(result.StringValues, val.Index(i).String()) + } + + return result +} diff --git a/protocol/marshal_test.go b/protocol/marshal_test.go new file mode 100644 index 0000000..6997da7 --- /dev/null +++ b/protocol/marshal_test.go @@ -0,0 +1,220 @@ +package protocol_test + +import ( + "testing" + + "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" +) + +func TestMarshal_Bool_Success(t *testing.T) { + input := struct { + IsDeleted bool + }{ + IsDeleted: true, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["IsDeleted"] + if !ok { + t.Fatal("IsDeleted not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeSingle { + t.Fatalf("Expected single value type, got %v", nameVal.Type) + } + + if s, ok := nameVal.SingleValue.(*rpcv1.ModuleSpec_Value_BoolValue); !ok { + t.Fatalf("Expected string value, got %v", nameVal.SingleValue) + } else if !s.BoolValue { + t.Errorf("Expected bool value to be true, got %t", s.BoolValue) + } +} + +func TestMarshal_BoolSlice_Success(t *testing.T) { + input := struct { + IsDeleted []bool + }{ + IsDeleted: []bool{true}, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["IsDeleted"] + if !ok { + t.Fatal("IsDeleted not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeBoolSlice { + t.Fatalf("Expected bool slice value type, got %v", nameVal.Type) + } + + if len(nameVal.BoolValues) < 1 { + t.Fatalf("Expected at least one bool value, got %d", len(nameVal.BoolValues)) + } + + if !nameVal.BoolValues[0] { + t.Errorf("Expected bool value to be true, got %t", nameVal.BoolValues[0]) + } +} + +func TestMarshal_Int_Success(t *testing.T) { + input := struct { + Age int + }{ + Age: 42, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["Age"] + if !ok { + t.Fatal("Age not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeSingle { + t.Fatalf("Expected single value type, got %v", nameVal.Type) + } + + if s, ok := nameVal.SingleValue.(*rpcv1.ModuleSpec_Value_IntValue); !ok { + t.Fatalf("Expected string value, got %v", nameVal.SingleValue) + } else if s.IntValue != 42 { + t.Errorf("Expected int value to be 42, got %d", s.IntValue) + } +} + +func TestMarshal_IntSlice_Success(t *testing.T) { + input := struct { + Ages []int + }{ + Ages: []int{42}, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["Ages"] + if !ok { + t.Fatal("Ages not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeIntSlice { + t.Fatalf("Expected int slice value type, got %v", nameVal.Type) + } + + if len(nameVal.IntValues) < 1 { + t.Fatalf("Expected at least one bool value, got %d", len(nameVal.BoolValues)) + } + + if nameVal.IntValues[0] != 42 { + t.Errorf("Expected int value to be 52, got %d", nameVal.IntValues[0]) + } +} + +func TestMarshal_StringField_Success(t *testing.T) { + input := struct { + Name string + }{ + Name: "John Doe", + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["Name"] + if !ok { + t.Fatal("Name not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeSingle { + t.Fatalf("Expected single value type, got %v", nameVal.Type) + } + + if s, ok := nameVal.SingleValue.(*rpcv1.ModuleSpec_Value_StringValue); !ok { + t.Fatalf("Expected string value, got %v", nameVal.SingleValue) + } else if s.StringValue != "John Doe" { + t.Errorf("Expected string value to be John Doe, got %s", s.StringValue) + } +} + +func TestMarshal_Float64_Success(t *testing.T) { + input := struct { + Pi float64 + }{ + Pi: 3.14, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + nameVal, ok := spec.Values["Pi"] + if !ok { + t.Fatal("Pi not found") + } + + if nameVal.Type != rpcv1.ModuleSpec_ValueTypeSingle { + t.Fatalf("Expected single value type, got %v", nameVal.Type) + } + + if s, ok := nameVal.SingleValue.(*rpcv1.ModuleSpec_Value_DoubleValue); !ok { + t.Fatalf("Expected double value, got %v", nameVal.SingleValue) + } else if s.DoubleValue-3.14 > 0.000001 { + t.Errorf("Expected double value to be 3.14, got %f", s.DoubleValue) + } +} + +func TestMarshal_NestedStruct_Success(t *testing.T) { + type Address struct { + City string + } + input := struct { + Address Address + }{ + Address: Address{ + City: "New York", + }, + } + + spec, err := protocol.Marshal(input) + if err != nil { + t.Fatal(err) + } + + addressVal, ok := spec.Values["Address"] + if !ok { + t.Fatal("Address not found") + } + + if addressVal.Type != rpcv1.ModuleSpec_ValueTypeObject { + t.Fatalf("Expected object value type, got %v", addressVal.Type) + } + + cityVal, ok := addressVal.ComplexValue["City"] + if !ok { + t.Fatal("City not found") + } + + if cityVal.Type != rpcv1.ModuleSpec_ValueTypeSingle { + t.Fatalf("Expected single value type, got %v", cityVal.Type) + } + + if cityVal.SingleValue.(*rpcv1.ModuleSpec_Value_StringValue).StringValue != "New York" { + t.Errorf("Expected string value to be New York, got %s", cityVal.SingleValue.(*rpcv1.ModuleSpec_Value_StringValue).StringValue) + } +} diff --git a/protocol/unmarshal.go b/protocol/unmarshal.go new file mode 100644 index 0000000..bca0b7c --- /dev/null +++ b/protocol/unmarshal.go @@ -0,0 +1,208 @@ +package protocol + +import ( + "errors" + "fmt" + "reflect" + "strings" + + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" +) + +var ( + ErrUnmatchingType = errors.New("field type does not match wire value") +) + +func Unmarshal(input *rpcv1.ModuleSpec, into any) error { + cfg := unmarshalConfig{ + TagName: "hcl", + } + + val := reflect.ValueOf(into) + if val.Kind() != reflect.Ptr { + return errors.New("into value must be a pointer") + } + return cfg.unmarshal(input.Values, val.Elem(), reflect.TypeOf(into).Elem()) +} + +type unmarshalConfig struct { + TagName string +} + +func (cfg unmarshalConfig) unmarshal(input map[string]*rpcv1.ModuleSpec_Value, into reflect.Value, intoType reflect.Type) error { + for i := 0; i < intoType.NumField(); i++ { + tf := intoType.Field(i) + if !tf.IsExported() { + continue + } + + fieldName := cfg.fieldName(tf) + + val, ok := input[fieldName] + if !ok { + continue + } + + if mapped, err := cfg.mapSpecValueTo(val, tf.Type); err != nil { + return fmt.Errorf("failed to map value for field %s: %w", tf.Name, err) + } else if into.Type().Kind() == reflect.Pointer { + into.Elem().Field(i).Set(mapped) + } else { + into.Field(i).Set(mapped) + } + + delete(input, fieldName) + } + + if len(input) > 0 { + keys := make([]string, 0, len(input)) + for k := range input { + keys = append(keys, k) + } + return fmt.Errorf("unknown fields: %v", keys) + } + + return nil +} + +func (cfg unmarshalConfig) mapSpecValueTo(val *rpcv1.ModuleSpec_Value, targetType reflect.Type) (reflect.Value, error) { + switch val.Type { + case rpcv1.ModuleSpec_ValueTypeUnknown: + return reflect.Value{}, ErrUnmatchingType + case rpcv1.ModuleSpec_ValueTypeObject: + if targetType.Kind() == reflect.Struct { + structVal := reflect.New(targetType) + if err := cfg.unmarshal(val.ComplexValue, structVal, targetType); err != nil { + return reflect.Value{}, err + } else { + return structVal.Elem(), nil + } + } else if targetType.Kind() == reflect.Pointer && targetType.Elem().Kind() == reflect.Struct { + structVal := reflect.New(targetType.Elem()) + if err := cfg.unmarshal(val.ComplexValue, structVal, targetType.Elem()); err != nil { + return reflect.Value{}, err + } else { + return structVal, nil + } + } else if targetType.Kind() != reflect.Map { + return reflect.Value{}, fmt.Errorf("%w: expected struct, got %s", ErrUnmatchingType, targetType.String()) + } + fallthrough + case rpcv1.ModuleSpec_ValueTypeMap: + if targetType.Kind() != reflect.Map { + return reflect.Value{}, fmt.Errorf("%w: expected map, got %v", ErrUnmatchingType, targetType) + } + + mapVal := reflect.MakeMap(targetType) + + for k, v := range val.ComplexValue { + if mappedVal, err := cfg.mapSpecValueTo(v, targetType.Elem()); err != nil { + return reflect.Value{}, err + } else { + mapVal.SetMapIndex(reflect.ValueOf(k), mappedVal) + } + } + + return mapVal, nil + + case rpcv1.ModuleSpec_ValueTypeSingle: + switch sv := val.SingleValue.(type) { + case *rpcv1.ModuleSpec_Value_BoolValue: + if targetType.Kind() != reflect.Bool { + return reflect.Value{}, fmt.Errorf("%w: expected bool, got %v", ErrUnmatchingType, targetType) + } + return reflect.ValueOf(sv.BoolValue), nil + case *rpcv1.ModuleSpec_Value_StringValue: + if targetType.Kind() != reflect.String { + return reflect.Value{}, fmt.Errorf("%w: expected string, got %v", ErrUnmatchingType, targetType) + } + return reflect.ValueOf(sv.StringValue), nil + case *rpcv1.ModuleSpec_Value_IntValue: + if targetType.Kind() != reflect.Int { + return reflect.Value{}, fmt.Errorf("%w: expected int, got %v", ErrUnmatchingType, targetType) + } + return reflect.ValueOf(int(sv.IntValue)), nil + case *rpcv1.ModuleSpec_Value_DoubleValue: + if targetType.Kind() != reflect.Float64 { + return reflect.Value{}, fmt.Errorf("%w: expected float64, got %v", ErrUnmatchingType, targetType) + } + return reflect.ValueOf(sv.DoubleValue), nil + } + case rpcv1.ModuleSpec_ValueTypeBoolSlice: + if targetType.Kind() != reflect.Slice { + return reflect.Value{}, fmt.Errorf("%w: expected slice, got %v", ErrUnmatchingType, targetType) + } else if targetType.Elem().Kind() != reflect.Bool { + return reflect.Value{}, fmt.Errorf("%w: expected bool, got %v", ErrUnmatchingType, targetType.Elem()) + } + return reflect.ValueOf(val.BoolValues), nil + case rpcv1.ModuleSpec_ValueTypeStringSlice: + if targetType.Kind() != reflect.Slice { + return reflect.Value{}, fmt.Errorf("%w: expected slice, got %v", ErrUnmatchingType, targetType) + } else if targetType.Elem().Kind() != reflect.String { + return reflect.Value{}, fmt.Errorf("%w: expected string, got %v", ErrUnmatchingType, targetType.Elem()) + } + return reflect.ValueOf(val.StringValues), nil + case rpcv1.ModuleSpec_ValueTypeIntSlice: + if targetType.Kind() != reflect.Slice { + return reflect.Value{}, fmt.Errorf("%w: expected slice, got %v", ErrUnmatchingType, targetType) + } + switch targetType.Elem().Kind() { + case reflect.Int: + return reflect.ValueOf(convertNumericSlice[int64, int](val.IntValues)), nil + case reflect.Int8: + return reflect.ValueOf(convertNumericSlice[int64, int8](val.IntValues)), nil + case reflect.Int16: + return reflect.ValueOf(convertNumericSlice[int64, int16](val.IntValues)), nil + case reflect.Int32: + return reflect.ValueOf(convertNumericSlice[int64, int32](val.IntValues)), nil + case reflect.Int64: + return reflect.ValueOf(val.IntValues), nil + default: + return reflect.Value{}, fmt.Errorf("%w: expected int, got %v", ErrUnmatchingType, targetType.Elem()) + } + case rpcv1.ModuleSpec_ValueTypeDoubleSlice: + if targetType.Kind() != reflect.Slice { + return reflect.Value{}, fmt.Errorf("%w: expected slice, got %v", ErrUnmatchingType, targetType) + } + switch targetType.Elem().Kind() { + case reflect.Float32: + return reflect.ValueOf(convertNumericSlice[float64, float32](val.DoubleValues)), nil + case reflect.Float64: + return reflect.ValueOf(val.DoubleValues), nil + default: + return reflect.Value{}, fmt.Errorf("%w: expected int, got %v", ErrUnmatchingType, targetType.Elem()) + } + } + + return reflect.Value{}, nil +} + +func (cfg unmarshalConfig) fieldName(field reflect.StructField) string { + tagVal, ok := field.Tag.Lookup(cfg.TagName) + if !ok { + return field.Name + } + + split := strings.Split(tagVal, ",") + + switch { + case len(split) == 0: + fallthrough + case split[0] == "": + return strings.ToLower(field.Name) + default: + return strings.ToLower(split[0]) + } +} + +type numeric interface { + Integer | Float +} + +func convertNumericSlice[TIn numeric, TOut numeric](input []TIn) []TOut { + output := make([]TOut, len(input)) + for i, v := range input { + output[i] = TOut(v) + } + return output +} diff --git a/protocol/unmarshal_test.go b/protocol/unmarshal_test.go new file mode 100644 index 0000000..7c89515 --- /dev/null +++ b/protocol/unmarshal_test.go @@ -0,0 +1,515 @@ +package protocol_test + +import ( + "testing" + + "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" + rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" +) + +func TestUnmarshal_Bool_Success(t *testing.T) { + target := struct { + Delete bool + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Delete": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_BoolValue{ + BoolValue: true, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if !target.Delete { + t.Errorf("Expected Delete to be true") + } +} + +func TestUnmarshal_Bool_Err(t *testing.T) { + target := struct { + Delete string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Delete": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_BoolValue{ + BoolValue: true, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_Bool_Slice_Success(t *testing.T) { + target := struct { + Delete []bool + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Delete": { + Type: rpcv1.ModuleSpec_ValueTypeBoolSlice, + BoolValues: []bool{true}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if len(target.Delete) < 1 { + t.Errorf("Expected Delete to have at least one element") + } else if !target.Delete[0] { + t.Errorf("Expected Delete[0] to be true") + } +} + +func TestUnmarshal_Bool_Slice_Err(t *testing.T) { + target := struct { + Delete []string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Delete": { + Type: rpcv1.ModuleSpec_ValueTypeBoolSlice, + BoolValues: []bool{true}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_String_Success(t *testing.T) { + target := struct { + Name string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Name": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "Ted", + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Name != "Ted" { + t.Errorf("Expected Name to be 'Ted'") + } +} + +func TestUnmarshal_String_Err(t *testing.T) { + target := struct { + Name int + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Name": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "Ted", + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_String_Slice_Success(t *testing.T) { + target := struct { + Names []string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Names": { + Type: rpcv1.ModuleSpec_ValueTypeStringSlice, + StringValues: []string{"Ted"}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if len(target.Names) < 1 { + t.Errorf("Expected Names to have at least one element") + } else if target.Names[0] != "Ted" { + t.Errorf("Expected Names[0] to be 'Ted'") + } +} + +func TestUnmarshal_String_Slice_Err(t *testing.T) { + target := struct { + Names []int + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Names": { + Type: rpcv1.ModuleSpec_ValueTypeStringSlice, + StringValues: []string{"Ted"}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_Int_Success(t *testing.T) { + target := struct { + Age int + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Age": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_IntValue{ + IntValue: 42, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Age != 42 { + t.Errorf("Expected Age to be 42") + } +} + +func TestUnmarshal_Int_Err(t *testing.T) { + target := struct { + Age string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Age": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_IntValue{ + IntValue: 42, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_Int_Slice_Success(t *testing.T) { + target := struct { + Ages []int + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Ages": { + Type: rpcv1.ModuleSpec_ValueTypeIntSlice, + IntValues: []int64{42}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if len(target.Ages) < 1 { + t.Errorf("Expected Ages to have at least one element") + } else if target.Ages[0] != 42 { + t.Errorf("Expected Ages[0] to be 42") + } +} + +func TestUnmarshal_Int_Slice_Err(t *testing.T) { + target := struct { + Ages []string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Ages": { + Type: rpcv1.ModuleSpec_ValueTypeIntSlice, + IntValues: []int64{42}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_Double_Success(t *testing.T) { + target := struct { + Pi float64 + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Pi": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_DoubleValue{ + DoubleValue: 3.14, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Pi-3.14 > 0.0000001 { + t.Errorf("Expected Pi to be 3.14") + } +} + +func TestUnmarshal_Double_Err(t *testing.T) { + target := struct { + Pi string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Pi": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_DoubleValue{ + DoubleValue: 3.14, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_Double_Slice_Success(t *testing.T) { + target := struct { + Pis []float64 + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Pis": { + Type: rpcv1.ModuleSpec_ValueTypeDoubleSlice, + DoubleValues: []float64{3.14}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if len(target.Pis) < 1 { + t.Errorf("Expected Pis to have at least one element") + } else if target.Pis[0]-3.14 > 0.0000001 { + t.Errorf("Expected Pis[0] to be 3.14") + } +} + +func TestUnmarshal_Double_Slice_Err(t *testing.T) { + target := struct { + Pis []string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Pis": { + Type: rpcv1.ModuleSpec_ValueTypeDoubleSlice, + DoubleValues: []float64{3.14}, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err == nil { + t.Errorf("Expected error") + } else { + t.Log(err.Error()) + } +} + +func TestUnmarshal_NestedStruct_Success(t *testing.T) { + target := struct { + Address struct { + City string + } + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Address": { + Type: rpcv1.ModuleSpec_ValueTypeObject, + ComplexValue: map[string]*rpcv1.ModuleSpec_Value{ + "City": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "New York", + }, + }, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Address.City != "New York" { + t.Errorf("Expected City to be 'New York'") + } +} + +func TestUnmarshal_NestedStructPointer_Success(t *testing.T) { + target := struct { + Address *struct { + City string + } + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Address": { + Type: rpcv1.ModuleSpec_ValueTypeObject, + ComplexValue: map[string]*rpcv1.ModuleSpec_Value{ + "City": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "New York", + }, + }, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Address.City != "New York" { + t.Errorf("Expected City to be 'New York'") + } +} + +func TestUnmarshal_Map_Success(t *testing.T) { + target := struct { + Values map[string]string + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "Values": { + Type: rpcv1.ModuleSpec_ValueTypeMap, + ComplexValue: map[string]*rpcv1.ModuleSpec_Value{ + "City": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "New York", + }, + }, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.Values["City"] != "New York" { + t.Errorf("Expected City to be 'New York'") + } +} + +func TestUnmarshal_NestedMap_Success(t *testing.T) { + target := struct { + City struct { + Labels map[string]string + } + }{} + + spec := &rpcv1.ModuleSpec{ + Values: map[string]*rpcv1.ModuleSpec_Value{ + "City": { + Type: rpcv1.ModuleSpec_ValueTypeObject, + ComplexValue: map[string]*rpcv1.ModuleSpec_Value{ + "Labels": { + Type: rpcv1.ModuleSpec_ValueTypeMap, + ComplexValue: map[string]*rpcv1.ModuleSpec_Value{ + "Region": { + Type: rpcv1.ModuleSpec_ValueTypeSingle, + SingleValue: &rpcv1.ModuleSpec_Value_StringValue{ + StringValue: "west", + }, + }, + }, + }, + }, + }, + }, + } + + if err := protocol.Unmarshal(spec, &target); err != nil { + t.Errorf("Failed to unmarshal: %v", err) + } + + if target.City.Labels["Region"] != "west" { + t.Errorf("Expected 'Region' to be 'west'") + } +} diff --git a/registry.go b/registry.go index 0821a6c..01a06f9 100644 --- a/registry.go +++ b/registry.go @@ -1,8 +1,6 @@ package sdk import ( - "fmt" - "strings" "sync" ) @@ -23,28 +21,21 @@ func (f RegistrationFunc) RegisterAt(registry *TypeRegistry) { func NewTypeRegistry() *TypeRegistry { return &TypeRegistry{ - registrations: make(map[string]Factory), + registrations: make(map[Reference]Factory), } } type TypeRegistry struct { lock sync.Mutex - registrations map[string]Factory + registrations map[Reference]Factory } func (r *TypeRegistry) List() (refs []Reference) { refs = make([]Reference, 0, len(r.registrations)) for k := range r.registrations { - split := strings.SplitN(k, "/", 2) - if len(split) < 2 { - continue - } - refs = append(refs, Reference{ - Category: Category(split[0]), - Type: split[1], - }) + refs = append(refs, k) } return refs @@ -66,6 +57,9 @@ func (r *TypeRegistry) Get(cat Category, moduleName string) Module { return f.Create() } -func specOf(cat Category, moduleName string) string { - return fmt.Sprintf("%s/%s", cat.String(), moduleName) +func specOf(cat Category, moduleName string) Reference { + return Reference{ + Category: cat, + Type: moduleName, + } }