refactor: move gRPC code to extra repo

This commit is contained in:
Peter 2023-08-17 17:04:58 +02:00
parent d53a1531e6
commit 959f4dbf37
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9
27 changed files with 17 additions and 10279 deletions

2
api.go
View file

@ -6,7 +6,7 @@ import (
"log/slog" "log/slog"
"time" "time"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
) )
type Category = rpcv1.Category type Category = rpcv1.Category

View file

@ -1,11 +0,0 @@
# WASI host - module data exchange
The module SDK re-uses a subset of protobuf messages also used in the remote protocol except for the `TaskOutput` message because WASI handles `STDOUT`/`STDERR` already.
The protobuf messages are not used with gRPC but only as binary encoded messages shared via pointers in the WASI modules memory.
The following 'RPC' calls are supported:
- `log_msg` accepting a pointer and an offset to a `TaskLog` message - won't return anything
- `get_state` accepting a pointer and an offset to a `GetStateRequest` message, returning a 64-bit integer (32-bit pointer, 32-bit size) to a `GetStateResponse` message
- `set_state` accepting a pointer and an offset to a `SetState` message, returning a 64-bit integer (32-bit pointer, 32-bit size) to a `Result` message optionally containing error details

View file

@ -1,11 +0,0 @@
version: v1
name: buf.build/buildr/buildr
breaking:
use:
- FILE
lint:
use:
- DEFAULT
except:
- PACKAGE_DIRECTORY_MATCH
allow_comment_ignores: true

View file

@ -1,71 +0,0 @@
syntax = "proto3";
package buildr.rpc.v1;
import "rpc/v1/spec.proto";
message Buildr {
message Repo {
string root = 1;
}
message GitHub {
string api_token = 1;
}
Repo repo = 1;
GitHub github = 2;
string bin_dir = 3;
string out_dir = 4;
}
message TaskReference {
string id = 1;
string name = 2;
ModuleReference module = 3;
}
message StartTaskRequest {
TaskReference reference = 1;
Buildr buildr = 2;
ModuleSpec spec = 3;
}
message TaskResult {
string error = 1;
string modified_files_archive_path = 2;
}
message TaskLog {
message LogAttribute {
string key = 1;
string value = 2;
}
int64 time = 1;
string message = 2;
int32 level = 3;
repeated LogAttribute attributes = 4;
}
message SetState {
bytes key = 1;
bytes data = 2;
}
message GetStateRequest {
bytes key = 1;
}
message GetStateResponse {
bytes key = 1;
bytes data = 2;
}
message Result {
bool success = 1;
string error = 2;
}
message PluginInventory {
repeated ModuleReference modules = 1;
}

View file

@ -1,100 +0,0 @@
syntax = "proto3";
package buildr.rpc.v1;
enum Category {
CategoryUnknown = 0;
CategoryTool = 1;
CategoryTask = 2;
CategoryBuild = 3;
CategoryPackage = 4;
}
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<string, Value> complex_value = 10;
oneof single_value {
string string_value = 11;
int64 int_value = 12;
double double_value = 13;
bool bool_value = 14;
}
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<string, Value> values = 3;
}
message ContainerCapabilities {
repeated string add = 1;
repeated string drop = 2;
}
message ContainerBindMount {
string target = 1;
string source = 2;
bool read_only = 3;
}
message ContainerTmpfsMount {
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;
}
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;
}
message TaskSpec {
string module_name = 1;
ModuleSpec module_spec = 2;
ContainerSpec container = 3;
string output_dir = 4;
}

View file

@ -1,44 +0,0 @@
syntax = "proto3";
package buildr.rpc.v1;
import "rpc/v1/spec.proto";
message ProcessStartRequest {
string command = 1;
repeated string args = 2;
string working_directory = 3;
map<string, string> environment = 4;
bytes stdin = 5;
}
message ProcessStartResponse {
int32 exit_code = 1;
string error = 2;
bytes stderr = 3;
}
message LookupPathRequest {
string command = 1;
}
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;
}

View file

@ -1,17 +0,0 @@
version: v1
managed:
enabled: true
go_package_prefix:
default: code.icb4dc0.de/buildr/wasi-module-sdk-go/internal
except:
- buf.build/googleapis/googleapis
plugins:
- plugin: buf.build/protocolbuffers/go:v1.30.0
out: ./protocol/generated/
opt: paths=source_relative
- plugin: go-vtproto
out: ./protocol/generated/
opt:
- features=marshal+unmarshal+size+pool
- paths=source_relative
revision: 1

View file

@ -1,3 +0,0 @@
version: v1
directories:
- api/

View file

@ -1,4 +0,0 @@
version: v1
name: buf.build/buildr/module-sdk-go
deps:
- buf.build/buildr/buildr

View file

@ -6,9 +6,9 @@ import (
_ "github.com/tetratelabs/tinymem" _ "github.com/tetratelabs/tinymem"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )
var defaultRegistry = NewTypeRegistry() var defaultRegistry = NewTypeRegistry()

View file

@ -5,8 +5,8 @@ import (
"log/slog" "log/slog"
"os" "os"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/exec" "code.icb4dc0.de/buildr/wasi-module-sdk-go/exec"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go" sdk "code.icb4dc0.de/buildr/wasi-module-sdk-go"
) )

View file

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"io" "io"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "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 { func NewCommand(name string, args ...string) *Command {

View file

@ -4,8 +4,8 @@ import (
"errors" "errors"
"fmt" "fmt"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )
func LookPath(file string) (string, error) { func LookPath(file string) (string, error) {

5
go.mod
View file

@ -7,4 +7,7 @@ require (
google.golang.org/protobuf v1.31.0 google.golang.org/protobuf v1.31.0
) )
require github.com/google/go-cmp v0.5.9 // indirect require (
code.icb4dc0.de/buildr/api v0.0.0-20230816155529-748bd2ef327b // indirect
github.com/google/go-cmp v0.5.9 // indirect
)

2
go.sum
View file

@ -1,3 +1,5 @@
code.icb4dc0.de/buildr/api v0.0.0-20230816155529-748bd2ef327b h1:S7h+UltAjzuBQMlIkRk765DS5+Mq6G/nHWxOG7do/9U=
code.icb4dc0.de/buildr/api v0.0.0-20230816155529-748bd2ef327b/go.mod h1:iI2z7GsD9jIb1Cnsn6Nu4Iu/f5iPDAJ7WkGefsZosfw=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/google/go-cmp v0.5.5/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 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=

View file

@ -7,8 +7,8 @@ import (
"context" "context"
"log/slog" "log/slog"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1"
) )
var _ slog.Handler = (*WASIHandler)(nil) var _ slog.Handler = (*WASIHandler)(nil)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,660 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.30.0
// protoc (unknown)
// source: rpc/v1/wasi.proto
package rpcv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ProcessStartRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
WorkingDirectory string `protobuf:"bytes,3,opt,name=working_directory,json=workingDirectory,proto3" json:"working_directory,omitempty"`
Environment map[string]string `protobuf:"bytes,4,rep,name=environment,proto3" json:"environment,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Stdin []byte `protobuf:"bytes,5,opt,name=stdin,proto3" json:"stdin,omitempty"`
}
func (x *ProcessStartRequest) Reset() {
*x = ProcessStartRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_wasi_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProcessStartRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProcessStartRequest) ProtoMessage() {}
func (x *ProcessStartRequest) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_wasi_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProcessStartRequest.ProtoReflect.Descriptor instead.
func (*ProcessStartRequest) Descriptor() ([]byte, []int) {
return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{0}
}
func (x *ProcessStartRequest) GetCommand() string {
if x != nil {
return x.Command
}
return ""
}
func (x *ProcessStartRequest) GetArgs() []string {
if x != nil {
return x.Args
}
return nil
}
func (x *ProcessStartRequest) GetWorkingDirectory() string {
if x != nil {
return x.WorkingDirectory
}
return ""
}
func (x *ProcessStartRequest) GetEnvironment() map[string]string {
if x != nil {
return x.Environment
}
return nil
}
func (x *ProcessStartRequest) GetStdin() []byte {
if x != nil {
return x.Stdin
}
return nil
}
type ProcessStartResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ExitCode int32 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
Stderr []byte `protobuf:"bytes,3,opt,name=stderr,proto3" json:"stderr,omitempty"`
}
func (x *ProcessStartResponse) Reset() {
*x = ProcessStartResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_wasi_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProcessStartResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProcessStartResponse) ProtoMessage() {}
func (x *ProcessStartResponse) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_wasi_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 ProcessStartResponse.ProtoReflect.Descriptor instead.
func (*ProcessStartResponse) Descriptor() ([]byte, []int) {
return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{1}
}
func (x *ProcessStartResponse) GetExitCode() int32 {
if x != nil {
return x.ExitCode
}
return 0
}
func (x *ProcessStartResponse) GetError() string {
if x != nil {
return x.Error
}
return ""
}
func (x *ProcessStartResponse) GetStderr() []byte {
if x != nil {
return x.Stderr
}
return nil
}
type LookupPathRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
}
func (x *LookupPathRequest) Reset() {
*x = LookupPathRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_wasi_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LookupPathRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LookupPathRequest) ProtoMessage() {}
func (x *LookupPathRequest) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_wasi_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LookupPathRequest.ProtoReflect.Descriptor instead.
func (*LookupPathRequest) Descriptor() ([]byte, []int) {
return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{2}
}
func (x *LookupPathRequest) GetCommand() string {
if x != nil {
return x.Command
}
return ""
}
type LookupPathResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
}
func (x *LookupPathResponse) Reset() {
*x = LookupPathResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_wasi_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LookupPathResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LookupPathResponse) ProtoMessage() {}
func (x *LookupPathResponse) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_wasi_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LookupPathResponse.ProtoReflect.Descriptor instead.
func (*LookupPathResponse) Descriptor() ([]byte, []int) {
return file_rpc_v1_wasi_proto_rawDescGZIP(), []int{3}
}
func (x *LookupPathResponse) GetPath() string {
if x != nil {
return x.Path
}
return ""
}
func (x *LookupPathResponse) GetError() string {
if x != nil {
return x.Error
}
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, 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 (
file_rpc_v1_wasi_proto_rawDescOnce sync.Once
file_rpc_v1_wasi_proto_rawDescData = file_rpc_v1_wasi_proto_rawDesc
)
func file_rpc_v1_wasi_proto_rawDescGZIP() []byte {
file_rpc_v1_wasi_proto_rawDescOnce.Do(func() {
file_rpc_v1_wasi_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_v1_wasi_proto_rawDescData)
})
return file_rpc_v1_wasi_proto_rawDescData
}
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
(*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{
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() }
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 {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_rpc_v1_wasi_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProcessStartResponse); 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[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LookupPathRequest); 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[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LookupPathResponse); 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[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{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rpc_v1_wasi_proto_rawDesc,
NumEnums: 0,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_rpc_v1_wasi_proto_goTypes,
DependencyIndexes: file_rpc_v1_wasi_proto_depIdxs,
MessageInfos: file_rpc_v1_wasi_proto_msgTypes,
}.Build()
File_rpc_v1_wasi_proto = out.File
file_rpc_v1_wasi_proto_rawDesc = nil
file_rpc_v1_wasi_proto_goTypes = nil
file_rpc_v1_wasi_proto_depIdxs = nil
}

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"reflect" "reflect"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
) )
var ErrExpectedStruct = errors.New("expected struct") var ErrExpectedStruct = errors.New("expected struct")

View file

@ -3,8 +3,8 @@ package protocol_test
import ( import (
"testing" "testing"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" "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) { func TestMarshal_Bool_Success(t *testing.T) {

View file

@ -6,7 +6,7 @@ import (
"reflect" "reflect"
"strings" "strings"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
) )
var ErrUnmatchingType = errors.New("field type does not match wire value") var ErrUnmatchingType = errors.New("field type does not match wire value")

View file

@ -3,8 +3,8 @@ package protocol_test
import ( import (
"testing" "testing"
rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol" "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) { func TestUnmarshal_Bool_Success(t *testing.T) {

View file

@ -3,7 +3,7 @@ package sdk
import ( import (
"errors" "errors"
rpcv1 "code.icb4dc0.de/buildr/wasi-module-sdk-go/protocol/generated/rpc/v1" rpcv1 "code.icb4dc0.de/buildr/api/generated/rpc/v1"
"code.icb4dc0.de/buildr/wasi-module-sdk-go/mem" "code.icb4dc0.de/buildr/wasi-module-sdk-go/mem"
) )