feat: provide plugin inventory

This commit is contained in:
Peter 2023-05-13 17:46:09 +02:00
parent e9ef69ca1f
commit 25ec63d350
No known key found for this signature in database
8 changed files with 718 additions and 174 deletions

View file

@ -15,14 +15,18 @@ message Buildr {
} }
message ModuleReference { message ModuleReference {
string task_id = 1; string module_category = 1;
string module_category = 2; string module_type = 2;
string module_type = 3; }
string module_name = 4;
message TaskReference {
string id = 1;
string name = 2;
ModuleReference module = 3;
} }
message StartTaskRequest { message StartTaskRequest {
ModuleReference reference = 1; TaskReference reference = 1;
Buildr buildr = 2; Buildr buildr = 2;
bytes raw_task = 3; bytes raw_task = 3;
} }
@ -62,3 +66,7 @@ message Result {
bool success = 1; bool success = 1;
string error = 2; string error = 2;
} }
message PluginInventory {
repeated ModuleReference modules = 1;
}

View file

@ -14,6 +14,25 @@ func Register(cat Category, moduleName string, factory Factory) {
defaultRegistry.Add(cat, moduleName, factory) defaultRegistry.Add(cat, moduleName, factory)
} }
//export inventory
func Inventory() uint64 {
var inventory rpcv1.PluginInventory
for _, t := range defaultRegistry.List() {
inventory.Modules = append(inventory.Modules, &rpcv1.ModuleReference{
ModuleCategory: t.Category.String(),
ModuleType: t.Type,
})
}
data, err := inventory.MarshalVT()
if err != nil {
panic(err)
}
return mem.UnifyPtrSize(mem.DataToUnmanagedPtr(data))
}
//export run //export run
func Run(specPtr, specSize uint32) { func Run(specPtr, specSize uint32) {
var startTask rpcv1.StartTaskRequest var startTask rpcv1.StartTaskRequest
@ -23,12 +42,12 @@ func Run(specPtr, specSize uint32) {
} }
executor := NewExecutor(startTask.Buildr.Repo.Root, "", "") executor := NewExecutor(startTask.Buildr.Repo.Root, "", "")
reference := startTask.GetReference() reference := startTask.GetReference().GetModule()
module := defaultRegistry.Get(Category(reference.GetModuleCategory()), reference.GetModuleType()) module := defaultRegistry.Get(Category(reference.GetModuleCategory()), reference.GetModuleType())
if err := easyjson.Unmarshal(startTask.RawTask, module); err != nil { if err := easyjson.Unmarshal(startTask.RawTask, module); err != nil {
panic(err) panic(err)
} }
executor.Run(context.Background(), startTask.Reference.ModuleName, module) executor.Run(context.Background(), startTask.GetReference().GetName(), module)
} }

View file

@ -24,6 +24,11 @@ type memoryManager struct {
danglingAllocations []uint64 danglingAllocations []uint64
} }
func (m *memoryManager) Deallocate(ctx context.Context, ptr uint64) error {
_, err := m.deallocate.Call(ctx, ptr)
return err
}
func (m *memoryManager) WriteMessage(ctx context.Context, mod api.Module, msg Message) (uint64, error) { func (m *memoryManager) WriteMessage(ctx context.Context, mod api.Module, msg Message) (uint64, error) {
data, err := msg.MarshalVT() data, err := msg.MarshalVT()
if err != nil { if err != nil {

View file

@ -1,9 +1,11 @@
package integration package integration
import ( import (
"code.icb4dc0.de/buildr/wasi-module-sdk/internal/mem"
"context" "context"
"crypto/md5" "crypto/md5"
"errors" "errors"
"fmt"
"os" "os"
"time" "time"
@ -102,12 +104,25 @@ func (h *Host) Run(ctx context.Context, wasiPayload []byte, spec TestSpec) (err
return err return err
} }
h.memMgr = newMemoryManager(mod)
inv, err := h.getInventory(ctx, mod)
if err != nil {
return err
}
for _, ref := range inv {
fmt.Printf("%s/%s/n", ref.Category, ref.Type)
}
startTask := &rpcv1.StartTaskRequest{ startTask := &rpcv1.StartTaskRequest{
Reference: &rpcv1.ModuleReference{ Reference: &rpcv1.TaskReference{
TaskId: uuid.NewString(), Id: uuid.NewString(),
Module: &rpcv1.ModuleReference{
ModuleCategory: spec.ModuleCategory.String(), ModuleCategory: spec.ModuleCategory.String(),
ModuleType: spec.ModuleType, ModuleType: spec.ModuleType,
ModuleName: spec.ModuleName, },
Name: spec.ModuleName,
}, },
Buildr: &rpcv1.Buildr{ Buildr: &rpcv1.Buildr{
Repo: &rpcv1.Buildr_Repo{ Repo: &rpcv1.Buildr_Repo{
@ -123,7 +138,6 @@ func (h *Host) Run(ctx context.Context, wasiPayload []byte, spec TestSpec) (err
} }
run := mod.ExportedFunction("run") run := mod.ExportedFunction("run")
h.memMgr = newMemoryManager(mod)
defer func() { defer func() {
err = errors.Join(err, h.memMgr.Close()) err = errors.Join(err, h.memMgr.Close())
@ -142,6 +156,42 @@ func (h *Host) Run(ctx context.Context, wasiPayload []byte, spec TestSpec) (err
return err return err
} }
func (h *Host) getInventory(ctx context.Context, mod api.Module) (refs []sdk.Reference, err error) {
result, err := mod.ExportedFunction("inventory").Call(ctx)
if err != nil {
return nil, err
}
ptr, size := mem.UnifiedPtrToSizePtr(result[0])
if ptr == 0 {
return nil, errors.New("failed to get inventory - 0 pointer")
}
defer func() {
err = errors.Join(err, h.memMgr.Deallocate(ctx, uint64(ptr)))
}()
data, ok := mod.Memory().Read(ptr, size)
if !ok {
return nil, errors.New("failed to get inventory")
}
var inventory rpcv1.PluginInventory
if err = inventory.UnmarshalVT(data); err != nil {
return nil, err
}
refs = make([]sdk.Reference, 0, len(inventory.Modules))
for _, m := range inventory.Modules {
refs = append(refs, sdk.Reference{
Category: sdk.Category(m.GetModuleCategory()),
Type: m.GetModuleType(),
})
}
return refs, nil
}
func (h *Host) getState(ctx context.Context, m api.Module, offset, byteCount uint32) uint64 { func (h *Host) getState(ctx context.Context, m api.Module, offset, byteCount uint32) uint64 {
if h.state == nil { if h.state == nil {
h.state = make(map[string][]byte) h.state = make(map[string][]byte)

View file

@ -1,10 +1,20 @@
package mem package mem
// #include <stdlib.h>
import "C"
import "unsafe" import "unsafe"
func DataToManagedPtr(data []byte) (uint32, uint32) { func DataToManagedPtr(data []byte) (ptr uint32, size uint32) {
ptr := unsafe.Pointer(unsafe.SliceData(data)) uptr := unsafe.Pointer(unsafe.SliceData(data))
return uint32(uintptr(ptr)), uint32(len(data)) return uint32(uintptr(uptr)), uint32(len(data))
}
func DataToUnmanagedPtr(data []byte) (uint32, uint32) {
size := C.ulong(len(data))
ptr := unsafe.Pointer(C.malloc(size))
copy(unsafe.Slice((*byte)(ptr), len(data)), data)
return uint32(uintptr(ptr)), uint32(size)
} }
func DataFromPtr(ptr, size uint32) []byte { func DataFromPtr(ptr, size uint32) []byte {
@ -15,3 +25,11 @@ func DataFromPtr(ptr, size uint32) []byte {
func PtrToData(ptr uint32, size uint32) []byte { func PtrToData(ptr uint32, size uint32) []byte {
return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(ptr))), size) return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(ptr))), size)
} }
func UnifyPtrSize(ptr, size uint32) uint64 {
return (uint64(ptr) << uint64(32)) | uint64(size)
}
func UnifiedPtrToSizePtr(uint64ptr uint64) (ptr uint32, size uint32) {
return uint32(uint64ptr >> 32), uint32(uint64ptr)
}

View file

@ -80,10 +80,8 @@ type ModuleReference struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
TaskId string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` ModuleCategory string `protobuf:"bytes,1,opt,name=module_category,json=moduleCategory,proto3" json:"module_category,omitempty"`
ModuleCategory string `protobuf:"bytes,2,opt,name=module_category,json=moduleCategory,proto3" json:"module_category,omitempty"` ModuleType string `protobuf:"bytes,2,opt,name=module_type,json=moduleType,proto3" json:"module_type,omitempty"`
ModuleType string `protobuf:"bytes,3,opt,name=module_type,json=moduleType,proto3" json:"module_type,omitempty"`
ModuleName string `protobuf:"bytes,4,opt,name=module_name,json=moduleName,proto3" json:"module_name,omitempty"`
} }
func (x *ModuleReference) Reset() { func (x *ModuleReference) Reset() {
@ -118,13 +116,6 @@ func (*ModuleReference) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{1} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{1}
} }
func (x *ModuleReference) GetTaskId() string {
if x != nil {
return x.TaskId
}
return ""
}
func (x *ModuleReference) GetModuleCategory() string { func (x *ModuleReference) GetModuleCategory() string {
if x != nil { if x != nil {
return x.ModuleCategory return x.ModuleCategory
@ -139,19 +130,75 @@ func (x *ModuleReference) GetModuleType() string {
return "" return ""
} }
func (x *ModuleReference) GetModuleName() string { type TaskReference struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Module *ModuleReference `protobuf:"bytes,3,opt,name=module,proto3" json:"module,omitempty"`
}
func (x *TaskReference) Reset() {
*x = TaskReference{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TaskReference) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TaskReference) ProtoMessage() {}
func (x *TaskReference) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_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 TaskReference.ProtoReflect.Descriptor instead.
func (*TaskReference) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{2}
}
func (x *TaskReference) GetId() string {
if x != nil { if x != nil {
return x.ModuleName return x.Id
} }
return "" return ""
} }
func (x *TaskReference) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *TaskReference) GetModule() *ModuleReference {
if x != nil {
return x.Module
}
return nil
}
type StartTaskRequest struct { type StartTaskRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Reference *ModuleReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` Reference *TaskReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"`
Buildr *Buildr `protobuf:"bytes,2,opt,name=buildr,proto3" json:"buildr,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"` RawTask []byte `protobuf:"bytes,3,opt,name=raw_task,json=rawTask,proto3" json:"raw_task,omitempty"`
} }
@ -159,7 +206,7 @@ type StartTaskRequest struct {
func (x *StartTaskRequest) Reset() { func (x *StartTaskRequest) Reset() {
*x = StartTaskRequest{} *x = StartTaskRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[2] mi := &file_rpc_v1_executor_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -172,7 +219,7 @@ func (x *StartTaskRequest) String() string {
func (*StartTaskRequest) ProtoMessage() {} func (*StartTaskRequest) ProtoMessage() {}
func (x *StartTaskRequest) ProtoReflect() protoreflect.Message { func (x *StartTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[2] mi := &file_rpc_v1_executor_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -185,10 +232,10 @@ func (x *StartTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use StartTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use StartTaskRequest.ProtoReflect.Descriptor instead.
func (*StartTaskRequest) Descriptor() ([]byte, []int) { func (*StartTaskRequest) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{2} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{3}
} }
func (x *StartTaskRequest) GetReference() *ModuleReference { func (x *StartTaskRequest) GetReference() *TaskReference {
if x != nil { if x != nil {
return x.Reference return x.Reference
} }
@ -221,7 +268,7 @@ type TaskResult struct {
func (x *TaskResult) Reset() { func (x *TaskResult) Reset() {
*x = TaskResult{} *x = TaskResult{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[3] mi := &file_rpc_v1_executor_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -234,7 +281,7 @@ func (x *TaskResult) String() string {
func (*TaskResult) ProtoMessage() {} func (*TaskResult) ProtoMessage() {}
func (x *TaskResult) ProtoReflect() protoreflect.Message { func (x *TaskResult) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[3] mi := &file_rpc_v1_executor_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -247,7 +294,7 @@ func (x *TaskResult) ProtoReflect() protoreflect.Message {
// Deprecated: Use TaskResult.ProtoReflect.Descriptor instead. // Deprecated: Use TaskResult.ProtoReflect.Descriptor instead.
func (*TaskResult) Descriptor() ([]byte, []int) { func (*TaskResult) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{3} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4}
} }
func (x *TaskResult) GetError() string { func (x *TaskResult) GetError() string {
@ -278,7 +325,7 @@ type TaskLog struct {
func (x *TaskLog) Reset() { func (x *TaskLog) Reset() {
*x = TaskLog{} *x = TaskLog{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[4] mi := &file_rpc_v1_executor_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -291,7 +338,7 @@ func (x *TaskLog) String() string {
func (*TaskLog) ProtoMessage() {} func (*TaskLog) ProtoMessage() {}
func (x *TaskLog) ProtoReflect() protoreflect.Message { func (x *TaskLog) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[4] mi := &file_rpc_v1_executor_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -304,7 +351,7 @@ func (x *TaskLog) ProtoReflect() protoreflect.Message {
// Deprecated: Use TaskLog.ProtoReflect.Descriptor instead. // Deprecated: Use TaskLog.ProtoReflect.Descriptor instead.
func (*TaskLog) Descriptor() ([]byte, []int) { func (*TaskLog) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5}
} }
func (x *TaskLog) GetTime() int64 { func (x *TaskLog) GetTime() int64 {
@ -347,7 +394,7 @@ type SetState struct {
func (x *SetState) Reset() { func (x *SetState) Reset() {
*x = SetState{} *x = SetState{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[5] mi := &file_rpc_v1_executor_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -360,7 +407,7 @@ func (x *SetState) String() string {
func (*SetState) ProtoMessage() {} func (*SetState) ProtoMessage() {}
func (x *SetState) ProtoReflect() protoreflect.Message { func (x *SetState) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[5] mi := &file_rpc_v1_executor_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -373,7 +420,7 @@ func (x *SetState) ProtoReflect() protoreflect.Message {
// Deprecated: Use SetState.ProtoReflect.Descriptor instead. // Deprecated: Use SetState.ProtoReflect.Descriptor instead.
func (*SetState) Descriptor() ([]byte, []int) { func (*SetState) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{6}
} }
func (x *SetState) GetKey() []byte { func (x *SetState) GetKey() []byte {
@ -401,7 +448,7 @@ type GetStateRequest struct {
func (x *GetStateRequest) Reset() { func (x *GetStateRequest) Reset() {
*x = GetStateRequest{} *x = GetStateRequest{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[6] mi := &file_rpc_v1_executor_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -414,7 +461,7 @@ func (x *GetStateRequest) String() string {
func (*GetStateRequest) ProtoMessage() {} func (*GetStateRequest) ProtoMessage() {}
func (x *GetStateRequest) ProtoReflect() protoreflect.Message { func (x *GetStateRequest) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[6] mi := &file_rpc_v1_executor_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -427,7 +474,7 @@ func (x *GetStateRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetStateRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetStateRequest.ProtoReflect.Descriptor instead.
func (*GetStateRequest) Descriptor() ([]byte, []int) { func (*GetStateRequest) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{6} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{7}
} }
func (x *GetStateRequest) GetKey() []byte { func (x *GetStateRequest) GetKey() []byte {
@ -449,7 +496,7 @@ type GetStateResponse struct {
func (x *GetStateResponse) Reset() { func (x *GetStateResponse) Reset() {
*x = GetStateResponse{} *x = GetStateResponse{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[7] mi := &file_rpc_v1_executor_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -462,7 +509,7 @@ func (x *GetStateResponse) String() string {
func (*GetStateResponse) ProtoMessage() {} func (*GetStateResponse) ProtoMessage() {}
func (x *GetStateResponse) ProtoReflect() protoreflect.Message { func (x *GetStateResponse) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[7] mi := &file_rpc_v1_executor_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -475,7 +522,7 @@ func (x *GetStateResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetStateResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetStateResponse.ProtoReflect.Descriptor instead.
func (*GetStateResponse) Descriptor() ([]byte, []int) { func (*GetStateResponse) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{7} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{8}
} }
func (x *GetStateResponse) GetKey() []byte { func (x *GetStateResponse) GetKey() []byte {
@ -504,7 +551,7 @@ type Result struct {
func (x *Result) Reset() { func (x *Result) Reset() {
*x = Result{} *x = Result{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[8] mi := &file_rpc_v1_executor_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -517,7 +564,7 @@ func (x *Result) String() string {
func (*Result) ProtoMessage() {} func (*Result) ProtoMessage() {}
func (x *Result) ProtoReflect() protoreflect.Message { func (x *Result) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[8] mi := &file_rpc_v1_executor_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -530,7 +577,7 @@ func (x *Result) ProtoReflect() protoreflect.Message {
// Deprecated: Use Result.ProtoReflect.Descriptor instead. // Deprecated: Use Result.ProtoReflect.Descriptor instead.
func (*Result) Descriptor() ([]byte, []int) { func (*Result) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{8} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{9}
} }
func (x *Result) GetSuccess() bool { func (x *Result) GetSuccess() bool {
@ -547,6 +594,53 @@ func (x *Result) GetError() string {
return "" return ""
} }
type PluginInventory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Modules []*ModuleReference `protobuf:"bytes,1,rep,name=modules,proto3" json:"modules,omitempty"`
}
func (x *PluginInventory) Reset() {
*x = PluginInventory{}
if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PluginInventory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PluginInventory) ProtoMessage() {}
func (x *PluginInventory) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PluginInventory.ProtoReflect.Descriptor instead.
func (*PluginInventory) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{10}
}
func (x *PluginInventory) GetModules() []*ModuleReference {
if x != nil {
return x.Modules
}
return nil
}
type Buildr_Repo struct { type Buildr_Repo struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -558,7 +652,7 @@ type Buildr_Repo struct {
func (x *Buildr_Repo) Reset() { func (x *Buildr_Repo) Reset() {
*x = Buildr_Repo{} *x = Buildr_Repo{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[9] mi := &file_rpc_v1_executor_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -571,7 +665,7 @@ func (x *Buildr_Repo) String() string {
func (*Buildr_Repo) ProtoMessage() {} func (*Buildr_Repo) ProtoMessage() {}
func (x *Buildr_Repo) ProtoReflect() protoreflect.Message { func (x *Buildr_Repo) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[9] mi := &file_rpc_v1_executor_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -605,7 +699,7 @@ type Buildr_GitHub struct {
func (x *Buildr_GitHub) Reset() { func (x *Buildr_GitHub) Reset() {
*x = Buildr_GitHub{} *x = Buildr_GitHub{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[10] mi := &file_rpc_v1_executor_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -618,7 +712,7 @@ func (x *Buildr_GitHub) String() string {
func (*Buildr_GitHub) ProtoMessage() {} func (*Buildr_GitHub) ProtoMessage() {}
func (x *Buildr_GitHub) ProtoReflect() protoreflect.Message { func (x *Buildr_GitHub) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[10] mi := &file_rpc_v1_executor_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -653,7 +747,7 @@ type TaskLog_LogAttribute struct {
func (x *TaskLog_LogAttribute) Reset() { func (x *TaskLog_LogAttribute) Reset() {
*x = TaskLog_LogAttribute{} *x = TaskLog_LogAttribute{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_rpc_v1_executor_proto_msgTypes[11] mi := &file_rpc_v1_executor_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -666,7 +760,7 @@ func (x *TaskLog_LogAttribute) String() string {
func (*TaskLog_LogAttribute) ProtoMessage() {} func (*TaskLog_LogAttribute) ProtoMessage() {}
func (x *TaskLog_LogAttribute) ProtoReflect() protoreflect.Message { func (x *TaskLog_LogAttribute) ProtoReflect() protoreflect.Message {
mi := &file_rpc_v1_executor_proto_msgTypes[11] mi := &file_rpc_v1_executor_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -679,7 +773,7 @@ func (x *TaskLog_LogAttribute) ProtoReflect() protoreflect.Message {
// Deprecated: Use TaskLog_LogAttribute.ProtoReflect.Descriptor instead. // Deprecated: Use TaskLog_LogAttribute.ProtoReflect.Descriptor instead.
func (*TaskLog_LogAttribute) Descriptor() ([]byte, []int) { func (*TaskLog_LogAttribute) Descriptor() ([]byte, []int) {
return file_rpc_v1_executor_proto_rawDescGZIP(), []int{4, 0} return file_rpc_v1_executor_proto_rawDescGZIP(), []int{5, 0}
} }
func (x *TaskLog_LogAttribute) GetKey() string { func (x *TaskLog_LogAttribute) GetKey() string {
@ -712,21 +806,24 @@ var file_rpc_v1_executor_proto_rawDesc = []byte{
0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72,
0x6f, 0x6f, 0x74, 0x1a, 0x25, 0x0a, 0x06, 0x47, 0x69, 0x74, 0x48, 0x75, 0x62, 0x12, 0x1b, 0x0a, 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, 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, 0x95, 0x01, 0x0a, 0x0f, 0x4d, 0x52, 0x08, 0x61, 0x70, 0x69, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x0f, 0x4d, 0x6f,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x17, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x0a,
0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, 0x61,
0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64,
0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6b, 0x0a, 0x0d, 0x54, 0x61, 0x73, 0x6b, 0x52,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x06,
0x6d, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x61, 0x73, 0x6b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64,
0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x69, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x06, 0x6d, 0x6f,
0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x61,
0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 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, 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, 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, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x52, 0x06, 0x62, 0x75,
@ -763,19 +860,24 @@ var file_rpc_v1_executor_proto_rawDesc = []byte{
0x22, 0x38, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 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, 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, 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, 0x42, 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x4b, 0x0a, 0x0f, 0x50, 0x6c,
0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x38, 0x0a,
0x42, 0x0d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x07, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e,
0x01, 0x5a, 0x3c, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x2e, 0x4d,
0x64, 0x65, 0x2f, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x42, 0xb6, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
0x61, 0x6c, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x45,
0x02, 0x03, 0x42, 0x52, 0x58, 0xaa, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2e, 0x52, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3c,
0x70, 0x63, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x63, 0x62, 0x34, 0x64, 0x63, 0x30, 0x2e, 0x64, 0x65, 0x2f,
0x70, 0x63, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x5c, 0x52, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x2f, 0x77, 0x61, 0x73, 0x69, 0x2d, 0x6d, 0x6f, 0x64, 0x75,
0x70, 0x63, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x6c, 0x65, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x61, 0xea, 0x02, 0x0f, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x72, 0x3a, 0x3a, 0x52, 0x70, 0x63, 0x3a, 0x72, 0x70, 0x63, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x70, 0x63, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -790,32 +892,36 @@ func file_rpc_v1_executor_proto_rawDescGZIP() []byte {
return file_rpc_v1_executor_proto_rawDescData return file_rpc_v1_executor_proto_rawDescData
} }
var file_rpc_v1_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_rpc_v1_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
var file_rpc_v1_executor_proto_goTypes = []interface{}{ var file_rpc_v1_executor_proto_goTypes = []interface{}{
(*Buildr)(nil), // 0: buildr.rpc.v1.Buildr (*Buildr)(nil), // 0: buildr.rpc.v1.Buildr
(*ModuleReference)(nil), // 1: buildr.rpc.v1.ModuleReference (*ModuleReference)(nil), // 1: buildr.rpc.v1.ModuleReference
(*StartTaskRequest)(nil), // 2: buildr.rpc.v1.StartTaskRequest (*TaskReference)(nil), // 2: buildr.rpc.v1.TaskReference
(*TaskResult)(nil), // 3: buildr.rpc.v1.TaskResult (*StartTaskRequest)(nil), // 3: buildr.rpc.v1.StartTaskRequest
(*TaskLog)(nil), // 4: buildr.rpc.v1.TaskLog (*TaskResult)(nil), // 4: buildr.rpc.v1.TaskResult
(*SetState)(nil), // 5: buildr.rpc.v1.SetState (*TaskLog)(nil), // 5: buildr.rpc.v1.TaskLog
(*GetStateRequest)(nil), // 6: buildr.rpc.v1.GetStateRequest (*SetState)(nil), // 6: buildr.rpc.v1.SetState
(*GetStateResponse)(nil), // 7: buildr.rpc.v1.GetStateResponse (*GetStateRequest)(nil), // 7: buildr.rpc.v1.GetStateRequest
(*Result)(nil), // 8: buildr.rpc.v1.Result (*GetStateResponse)(nil), // 8: buildr.rpc.v1.GetStateResponse
(*Buildr_Repo)(nil), // 9: buildr.rpc.v1.Buildr.Repo (*Result)(nil), // 9: buildr.rpc.v1.Result
(*Buildr_GitHub)(nil), // 10: buildr.rpc.v1.Buildr.GitHub (*PluginInventory)(nil), // 10: buildr.rpc.v1.PluginInventory
(*TaskLog_LogAttribute)(nil), // 11: buildr.rpc.v1.TaskLog.LogAttribute (*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
} }
var file_rpc_v1_executor_proto_depIdxs = []int32{ var file_rpc_v1_executor_proto_depIdxs = []int32{
9, // 0: buildr.rpc.v1.Buildr.repo:type_name -> buildr.rpc.v1.Buildr.Repo 11, // 0: buildr.rpc.v1.Buildr.repo:type_name -> buildr.rpc.v1.Buildr.Repo
10, // 1: buildr.rpc.v1.Buildr.github:type_name -> buildr.rpc.v1.Buildr.GitHub 12, // 1: buildr.rpc.v1.Buildr.github:type_name -> buildr.rpc.v1.Buildr.GitHub
1, // 2: buildr.rpc.v1.StartTaskRequest.reference:type_name -> buildr.rpc.v1.ModuleReference 1, // 2: buildr.rpc.v1.TaskReference.module:type_name -> buildr.rpc.v1.ModuleReference
0, // 3: buildr.rpc.v1.StartTaskRequest.buildr:type_name -> buildr.rpc.v1.Buildr 2, // 3: buildr.rpc.v1.StartTaskRequest.reference:type_name -> buildr.rpc.v1.TaskReference
11, // 4: buildr.rpc.v1.TaskLog.attributes:type_name -> buildr.rpc.v1.TaskLog.LogAttribute 0, // 4: buildr.rpc.v1.StartTaskRequest.buildr:type_name -> buildr.rpc.v1.Buildr
5, // [5:5] is the sub-list for method output_type 13, // 5: buildr.rpc.v1.TaskLog.attributes:type_name -> buildr.rpc.v1.TaskLog.LogAttribute
5, // [5:5] is the sub-list for method input_type 1, // 6: buildr.rpc.v1.PluginInventory.modules:type_name -> buildr.rpc.v1.ModuleReference
5, // [5:5] is the sub-list for extension type_name 7, // [7:7] is the sub-list for method output_type
5, // [5:5] is the sub-list for extension extendee 7, // [7:7] is the sub-list for method input_type
0, // [0:5] is the sub-list for field type_name 7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
} }
func init() { file_rpc_v1_executor_proto_init() } func init() { file_rpc_v1_executor_proto_init() }
@ -849,7 +955,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[2].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 { switch v := v.(*TaskReference); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -861,7 +967,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[3].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 { switch v := v.(*StartTaskRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -873,7 +979,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[4].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 { switch v := v.(*TaskResult); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -885,7 +991,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[5].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 { switch v := v.(*TaskLog); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -897,7 +1003,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[6].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 { switch v := v.(*SetState); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -909,7 +1015,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[7].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 { switch v := v.(*GetStateRequest); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -921,7 +1027,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[8].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 { switch v := v.(*GetStateResponse); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -933,7 +1039,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { file_rpc_v1_executor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Buildr_Repo); i { switch v := v.(*Result); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -945,7 +1051,7 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[10].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_GitHub); i { switch v := v.(*PluginInventory); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:
@ -957,6 +1063,30 @@ func file_rpc_v1_executor_proto_init() {
} }
} }
file_rpc_v1_executor_proto_msgTypes[11].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_Repo); 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[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Buildr_GitHub); 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[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TaskLog_LogAttribute); i { switch v := v.(*TaskLog_LogAttribute); i {
case 0: case 0:
return &v.state return &v.state
@ -975,7 +1105,7 @@ func file_rpc_v1_executor_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_rpc_v1_executor_proto_rawDesc, RawDescriptor: file_rpc_v1_executor_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 12, NumMessages: 14,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View file

@ -181,31 +181,74 @@ func (m *ModuleReference) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
i -= len(m.unknownFields) i -= len(m.unknownFields)
copy(dAtA[i:], m.unknownFields) copy(dAtA[i:], m.unknownFields)
} }
if len(m.ModuleName) > 0 {
i -= len(m.ModuleName)
copy(dAtA[i:], m.ModuleName)
i = encodeVarint(dAtA, i, uint64(len(m.ModuleName)))
i--
dAtA[i] = 0x22
}
if len(m.ModuleType) > 0 { if len(m.ModuleType) > 0 {
i -= len(m.ModuleType) i -= len(m.ModuleType)
copy(dAtA[i:], m.ModuleType) copy(dAtA[i:], m.ModuleType)
i = encodeVarint(dAtA, i, uint64(len(m.ModuleType))) i = encodeVarint(dAtA, i, uint64(len(m.ModuleType)))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x12
} }
if len(m.ModuleCategory) > 0 { if len(m.ModuleCategory) > 0 {
i -= len(m.ModuleCategory) i -= len(m.ModuleCategory)
copy(dAtA[i:], m.ModuleCategory) copy(dAtA[i:], m.ModuleCategory)
i = encodeVarint(dAtA, i, uint64(len(m.ModuleCategory))) i = encodeVarint(dAtA, i, uint64(len(m.ModuleCategory)))
i-- i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func (m *TaskReference) 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 *TaskReference) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *TaskReference) 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.Module != nil {
size, err := m.Module.MarshalToSizedBufferVT(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarint(dAtA, i, uint64(size))
i--
dAtA[i] = 0x1a
}
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] = 0x12 dAtA[i] = 0x12
} }
if len(m.TaskId) > 0 { if len(m.Id) > 0 {
i -= len(m.TaskId) i -= len(m.Id)
copy(dAtA[i:], m.TaskId) copy(dAtA[i:], m.Id)
i = encodeVarint(dAtA, i, uint64(len(m.TaskId))) i = encodeVarint(dAtA, i, uint64(len(m.Id)))
i-- i--
dAtA[i] = 0xa dAtA[i] = 0xa
} }
@ -612,6 +655,51 @@ func (m *Result) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *PluginInventory) 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 *PluginInventory) MarshalToVT(dAtA []byte) (int, error) {
size := m.SizeVT()
return m.MarshalToSizedBufferVT(dAtA[:size])
}
func (m *PluginInventory) 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.Modules) > 0 {
for iNdEx := len(m.Modules) - 1; iNdEx >= 0; iNdEx-- {
size, err := m.Modules[iNdEx].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 encodeVarint(dAtA []byte, offset int, v uint64) int { func encodeVarint(dAtA []byte, offset int, v uint64) int {
offset -= sov(v) offset -= sov(v)
base := offset base := offset
@ -675,10 +763,6 @@ func (m *ModuleReference) SizeVT() (n int) {
} }
var l int var l int
_ = l _ = l
l = len(m.TaskId)
if l > 0 {
n += 1 + l + sov(uint64(l))
}
l = len(m.ModuleCategory) l = len(m.ModuleCategory)
if l > 0 { if l > 0 {
n += 1 + l + sov(uint64(l)) n += 1 + l + sov(uint64(l))
@ -687,10 +771,28 @@ func (m *ModuleReference) SizeVT() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sov(uint64(l)) n += 1 + l + sov(uint64(l))
} }
l = len(m.ModuleName) n += len(m.unknownFields)
return n
}
func (m *TaskReference) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = len(m.Id)
if l > 0 { if l > 0 {
n += 1 + l + sov(uint64(l)) n += 1 + l + sov(uint64(l))
} }
l = len(m.Name)
if l > 0 {
n += 1 + l + sov(uint64(l))
}
if m.Module != nil {
l = m.Module.SizeVT()
n += 1 + l + sov(uint64(l))
}
n += len(m.unknownFields) n += len(m.unknownFields)
return n return n
} }
@ -846,6 +948,22 @@ func (m *Result) SizeVT() (n int) {
return n return n
} }
func (m *PluginInventory) SizeVT() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if len(m.Modules) > 0 {
for _, e := range m.Modules {
l = e.SizeVT()
n += 1 + l + sov(uint64(l))
}
}
n += len(m.unknownFields)
return n
}
func sov(x uint64) (n int) { func sov(x uint64) (n int) {
return (bits.Len64(x|1) + 6) / 7 return (bits.Len64(x|1) + 6) / 7
} }
@ -1171,38 +1289,6 @@ func (m *ModuleReference) UnmarshalVT(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field TaskId", 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.TaskId = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ModuleCategory", wireType) return fmt.Errorf("proto: wrong wireType = %d for field ModuleCategory", wireType)
} }
@ -1234,7 +1320,7 @@ func (m *ModuleReference) UnmarshalVT(dAtA []byte) error {
} }
m.ModuleCategory = string(dAtA[iNdEx:postIndex]) m.ModuleCategory = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 3: case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ModuleType", wireType) return fmt.Errorf("proto: wrong wireType = %d for field ModuleType", wireType)
} }
@ -1266,9 +1352,60 @@ func (m *ModuleReference) UnmarshalVT(dAtA []byte) error {
} }
m.ModuleType = string(dAtA[iNdEx:postIndex]) m.ModuleType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 4: 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
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: TaskReference: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: TaskReference: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ModuleName", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
} }
var stringLen uint64 var stringLen uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1296,7 +1433,75 @@ func (m *ModuleReference) UnmarshalVT(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.ModuleName = string(dAtA[iNdEx:postIndex]) m.Id = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
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 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Module", 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.Module == nil {
m.Module = &ModuleReference{}
}
if err := m.Module.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
@ -1379,7 +1584,7 @@ func (m *StartTaskRequest) UnmarshalVT(dAtA []byte) error {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
if m.Reference == nil { if m.Reference == nil {
m.Reference = &ModuleReference{} m.Reference = &TaskReference{}
} }
if err := m.Reference.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { if err := m.Reference.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
return err return err
@ -2288,6 +2493,91 @@ func (m *Result) UnmarshalVT(dAtA []byte) error {
} }
return nil return nil
} }
func (m *PluginInventory) 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: PluginInventory: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: PluginInventory: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Modules", 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.Modules = append(m.Modules, &ModuleReference{})
if err := m.Modules[len(m.Modules)-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
}
func skip(dAtA []byte) (n int, err error) { func skip(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)

View file

@ -2,9 +2,15 @@ package sdk
import ( import (
"fmt" "fmt"
"strings"
"sync" "sync"
) )
type Reference struct {
Category Category
Type string
}
type Registration interface { type Registration interface {
RegisterAt(registry *TypeRegistry) RegisterAt(registry *TypeRegistry)
} }
@ -26,6 +32,24 @@ type TypeRegistry struct {
registrations map[string]Factory registrations map[string]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],
})
}
return refs
}
func (r *TypeRegistry) Add(cat Category, moduleName string, factory Factory) { func (r *TypeRegistry) Add(cat Category, moduleName string, factory Factory) {
r.lock.Lock() r.lock.Lock()
defer r.lock.Unlock() defer r.lock.Unlock()