From 5c41ffa32a927ef107d9f2080a38d4f1f2c0a879 Mon Sep 17 00:00:00 2001 From: Jens Drenhaus Date: Tue, 24 Sep 2024 15:56:39 +0200 Subject: [PATCH] feat: communication design: add 'Details'-RPC This RPC is intended to request further information from a single device or command. To allow for multiple different kinds of requested information in the future, the RPC request holds a 'keyword' field to specify the requested information. Signed-off-by: Jens Drenhaus --- cmds/dutagent/rpc.go | 8 + protobuf/dutctl/v1/dutctl.proto | 14 + protobuf/gen/dutctl/v1/dutctl.pb.go | 377 ++++++++++++------ .../v1/dutctlv1connect/dutctl.connect.go | 29 ++ 4 files changed, 316 insertions(+), 112 deletions(-) diff --git a/cmds/dutagent/rpc.go b/cmds/dutagent/rpc.go index 68a3415..f32dc15 100644 --- a/cmds/dutagent/rpc.go +++ b/cmds/dutagent/rpc.go @@ -2,6 +2,7 @@ package main import ( "context" + "errors" "log" "connectrpc.com/connect" @@ -48,3 +49,10 @@ func (a *rpcService) Commands( return res, nil } + +func (a *rpcService) Details( + _ context.Context, + _ *connect.Request[pb.DetailsRequest], +) (*connect.Response[pb.DetailsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("Details RPC not implemented")) +} diff --git a/protobuf/dutctl/v1/dutctl.proto b/protobuf/dutctl/v1/dutctl.proto index 6678cc6..7b922a6 100644 --- a/protobuf/dutctl/v1/dutctl.proto +++ b/protobuf/dutctl/v1/dutctl.proto @@ -8,6 +8,7 @@ option go_package = "github.com/BlindspotSoftware/dutctl/protobuf/gen/dutctl/v1; service DeviceService { rpc List(ListRequest) returns (ListResponse) {} rpc Commands(CommandsRequest) returns (CommandsResponse) {} + rpc Details(DetailsRequest) returns (DetailsResponse) {} rpc Run(stream RunRequest) returns (stream RunResponse) {} } @@ -31,6 +32,19 @@ message CommandsResponse { repeated string commands = 1; } +// DetailsRequest is sent by the client to request further information for specific +// device or a specific command. The type of information is defined by keyword. +message DetailsRequest { + string device = 1; + string cmd = 2; + string keyword = 3; +} + +// DetailsResponse is sent by the agent in response to a DetailsRequest. +message DetailsResponse { + string details = 1; +} + // RunRequest is sent by the client to start a command execution on a device and optionally // to further interact with the agent during the command execution. diff --git a/protobuf/gen/dutctl/v1/dutctl.pb.go b/protobuf/gen/dutctl/v1/dutctl.pb.go index 5542786..afe2fee 100644 --- a/protobuf/gen/dutctl/v1/dutctl.pb.go +++ b/protobuf/gen/dutctl/v1/dutctl.pb.go @@ -204,6 +204,119 @@ func (x *CommandsResponse) GetCommands() []string { return nil } +// DetailsRequest is sent by the client to request further information for specific +// device or a specific command. The type of information is defined by keyword. +type DetailsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Device string `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"` + Cmd string `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"` + Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` +} + +func (x *DetailsRequest) Reset() { + *x = DetailsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_dutctl_v1_dutctl_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DetailsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DetailsRequest) ProtoMessage() {} + +func (x *DetailsRequest) ProtoReflect() protoreflect.Message { + mi := &file_dutctl_v1_dutctl_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 DetailsRequest.ProtoReflect.Descriptor instead. +func (*DetailsRequest) Descriptor() ([]byte, []int) { + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{4} +} + +func (x *DetailsRequest) GetDevice() string { + if x != nil { + return x.Device + } + return "" +} + +func (x *DetailsRequest) GetCmd() string { + if x != nil { + return x.Cmd + } + return "" +} + +func (x *DetailsRequest) GetKeyword() string { + if x != nil { + return x.Keyword + } + return "" +} + +// DetailsResponse is sent by the agent in response to a DetailsRequest. +type DetailsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Details string `protobuf:"bytes,1,opt,name=details,proto3" json:"details,omitempty"` +} + +func (x *DetailsResponse) Reset() { + *x = DetailsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_dutctl_v1_dutctl_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DetailsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DetailsResponse) ProtoMessage() {} + +func (x *DetailsResponse) ProtoReflect() protoreflect.Message { + mi := &file_dutctl_v1_dutctl_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 DetailsResponse.ProtoReflect.Descriptor instead. +func (*DetailsResponse) Descriptor() ([]byte, []int) { + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{5} +} + +func (x *DetailsResponse) GetDetails() string { + if x != nil { + return x.Details + } + return "" +} + // RunRequest is sent by the client to start a command execution on a device and optionally // to further interact with the agent during the command execution. // The first RunRequest message sent to a agent must allways contain a Command message. @@ -223,7 +336,7 @@ type RunRequest struct { func (x *RunRequest) Reset() { *x = RunRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[4] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -236,7 +349,7 @@ func (x *RunRequest) String() string { func (*RunRequest) ProtoMessage() {} func (x *RunRequest) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[4] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -249,7 +362,7 @@ func (x *RunRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunRequest.ProtoReflect.Descriptor instead. func (*RunRequest) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{4} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{6} } func (m *RunRequest) GetMsg() isRunRequest_Msg { @@ -321,7 +434,7 @@ type RunResponse struct { func (x *RunResponse) Reset() { *x = RunResponse{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[5] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -334,7 +447,7 @@ func (x *RunResponse) String() string { func (*RunResponse) ProtoMessage() {} func (x *RunResponse) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[5] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -347,7 +460,7 @@ func (x *RunResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunResponse.ProtoReflect.Descriptor instead. func (*RunResponse) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{5} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{7} } func (m *RunResponse) GetMsg() isRunResponse_Msg { @@ -427,7 +540,7 @@ type Command struct { func (x *Command) Reset() { *x = Command{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[6] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -440,7 +553,7 @@ func (x *Command) String() string { func (*Command) ProtoMessage() {} func (x *Command) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[6] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -453,7 +566,7 @@ func (x *Command) ProtoReflect() protoreflect.Message { // Deprecated: Use Command.ProtoReflect.Descriptor instead. func (*Command) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{6} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{8} } func (x *Command) GetDevice() string { @@ -489,7 +602,7 @@ type Print struct { func (x *Print) Reset() { *x = Print{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[7] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -502,7 +615,7 @@ func (x *Print) String() string { func (*Print) ProtoMessage() {} func (x *Print) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[7] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -515,7 +628,7 @@ func (x *Print) ProtoReflect() protoreflect.Message { // Deprecated: Use Print.ProtoReflect.Descriptor instead. func (*Print) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{7} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{9} } func (x *Print) GetText() []byte { @@ -543,7 +656,7 @@ type Console struct { func (x *Console) Reset() { *x = Console{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[8] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -556,7 +669,7 @@ func (x *Console) String() string { func (*Console) ProtoMessage() {} func (x *Console) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[8] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -569,7 +682,7 @@ func (x *Console) ProtoReflect() protoreflect.Message { // Deprecated: Use Console.ProtoReflect.Descriptor instead. func (*Console) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{8} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{10} } func (m *Console) GetData() isConsole_Data { @@ -634,7 +747,7 @@ type FileRequest struct { func (x *FileRequest) Reset() { *x = FileRequest{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[9] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -647,7 +760,7 @@ func (x *FileRequest) String() string { func (*FileRequest) ProtoMessage() {} func (x *FileRequest) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[9] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -660,7 +773,7 @@ func (x *FileRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FileRequest.ProtoReflect.Descriptor instead. func (*FileRequest) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{9} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{11} } func (x *FileRequest) GetPath() string { @@ -683,7 +796,7 @@ type File struct { func (x *File) Reset() { *x = File{} if protoimpl.UnsafeEnabled { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[10] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -696,7 +809,7 @@ func (x *File) String() string { func (*File) ProtoMessage() {} func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_dutctl_v1_dutctl_proto_msgTypes[10] + mi := &file_dutctl_v1_dutctl_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -709,7 +822,7 @@ func (x *File) ProtoReflect() protoreflect.Message { // Deprecated: Use File.ProtoReflect.Descriptor instead. func (*File) Descriptor() ([]byte, []int) { - return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{10} + return file_dutctl_v1_dutctl_proto_rawDescGZIP(), []int{12} } func (x *File) GetPath() string { @@ -740,66 +853,78 @@ var file_dutctl_v1_dutctl_proto_rawDesc = []byte{ 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x22, 0x2e, 0x0a, 0x10, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, 0x52, 0x07, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x05, 0x0a, - 0x03, 0x6d, 0x73, 0x67, 0x22, 0xd1, 0x01, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x72, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x2e, - 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, - 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x3a, - 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x66, - 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x69, - 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, - 0x65, 0x42, 0x05, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x47, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, - 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, - 0x73, 0x22, 0x1b, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, - 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x22, 0x5d, - 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x05, 0x73, 0x74, 0x64, - 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x73, 0x74, 0x64, 0x69, - 0x6e, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x73, - 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, - 0x74, 0x64, 0x65, 0x72, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x21, 0x0a, - 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x22, 0x34, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x32, 0xcd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, - 0x12, 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x12, - 0x1a, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x64, 0x75, - 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3a, 0x0a, 0x03, 0x52, 0x75, - 0x6e, 0x12, 0x15, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, - 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x73, 0x70, 0x6f, 0x74, 0x53, 0x6f, - 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x64, 0x75, 0x74, 0x63, 0x74, - 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x76, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x0e, 0x44, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x63, 0x6d, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2b, 0x0a, + 0x0f, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x9a, 0x01, 0x0a, 0x0a, 0x52, + 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x75, 0x74, + 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x48, 0x00, + 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x73, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x75, 0x74, + 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x48, 0x00, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x66, 0x69, 0x6c, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, + 0x42, 0x05, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xd1, 0x01, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x05, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, + 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x0b, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, + 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x75, + 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x04, + 0x66, 0x69, 0x6c, 0x65, 0x42, 0x05, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x47, 0x0a, 0x07, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x63, 0x6d, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x6d, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, + 0x61, 0x72, 0x67, 0x73, 0x22, 0x1b, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x6e, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x74, 0x65, 0x78, + 0x74, 0x22, 0x5d, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x05, + 0x73, 0x74, 0x64, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x05, 0x73, + 0x74, 0x64, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x18, + 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, + 0x22, 0x21, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x22, 0x34, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, + 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x32, 0x91, 0x02, 0x0a, 0x0d, 0x44, 0x65, + 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x64, 0x75, + 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x08, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x12, 0x1a, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, + 0x07, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x19, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x3a, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x15, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x45, 0x5a, + 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x6c, 0x69, 0x6e, + 0x64, 0x73, 0x70, 0x6f, 0x74, 0x53, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2f, 0x64, 0x75, + 0x74, 0x63, 0x74, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x64, 0x75, 0x74, 0x63, 0x74, 0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x75, 0x74, 0x63, + 0x74, 0x6c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -814,36 +939,40 @@ func file_dutctl_v1_dutctl_proto_rawDescGZIP() []byte { return file_dutctl_v1_dutctl_proto_rawDescData } -var file_dutctl_v1_dutctl_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_dutctl_v1_dutctl_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_dutctl_v1_dutctl_proto_goTypes = []any{ (*ListRequest)(nil), // 0: dutctl.v1.ListRequest (*ListResponse)(nil), // 1: dutctl.v1.ListResponse (*CommandsRequest)(nil), // 2: dutctl.v1.CommandsRequest (*CommandsResponse)(nil), // 3: dutctl.v1.CommandsResponse - (*RunRequest)(nil), // 4: dutctl.v1.RunRequest - (*RunResponse)(nil), // 5: dutctl.v1.RunResponse - (*Command)(nil), // 6: dutctl.v1.Command - (*Print)(nil), // 7: dutctl.v1.Print - (*Console)(nil), // 8: dutctl.v1.Console - (*FileRequest)(nil), // 9: dutctl.v1.FileRequest - (*File)(nil), // 10: dutctl.v1.File + (*DetailsRequest)(nil), // 4: dutctl.v1.DetailsRequest + (*DetailsResponse)(nil), // 5: dutctl.v1.DetailsResponse + (*RunRequest)(nil), // 6: dutctl.v1.RunRequest + (*RunResponse)(nil), // 7: dutctl.v1.RunResponse + (*Command)(nil), // 8: dutctl.v1.Command + (*Print)(nil), // 9: dutctl.v1.Print + (*Console)(nil), // 10: dutctl.v1.Console + (*FileRequest)(nil), // 11: dutctl.v1.FileRequest + (*File)(nil), // 12: dutctl.v1.File } var file_dutctl_v1_dutctl_proto_depIdxs = []int32{ - 6, // 0: dutctl.v1.RunRequest.command:type_name -> dutctl.v1.Command - 8, // 1: dutctl.v1.RunRequest.console:type_name -> dutctl.v1.Console - 10, // 2: dutctl.v1.RunRequest.file:type_name -> dutctl.v1.File - 7, // 3: dutctl.v1.RunResponse.print:type_name -> dutctl.v1.Print - 8, // 4: dutctl.v1.RunResponse.console:type_name -> dutctl.v1.Console - 9, // 5: dutctl.v1.RunResponse.fileRequest:type_name -> dutctl.v1.FileRequest - 10, // 6: dutctl.v1.RunResponse.file:type_name -> dutctl.v1.File + 8, // 0: dutctl.v1.RunRequest.command:type_name -> dutctl.v1.Command + 10, // 1: dutctl.v1.RunRequest.console:type_name -> dutctl.v1.Console + 12, // 2: dutctl.v1.RunRequest.file:type_name -> dutctl.v1.File + 9, // 3: dutctl.v1.RunResponse.print:type_name -> dutctl.v1.Print + 10, // 4: dutctl.v1.RunResponse.console:type_name -> dutctl.v1.Console + 11, // 5: dutctl.v1.RunResponse.fileRequest:type_name -> dutctl.v1.FileRequest + 12, // 6: dutctl.v1.RunResponse.file:type_name -> dutctl.v1.File 0, // 7: dutctl.v1.DeviceService.List:input_type -> dutctl.v1.ListRequest 2, // 8: dutctl.v1.DeviceService.Commands:input_type -> dutctl.v1.CommandsRequest - 4, // 9: dutctl.v1.DeviceService.Run:input_type -> dutctl.v1.RunRequest - 1, // 10: dutctl.v1.DeviceService.List:output_type -> dutctl.v1.ListResponse - 3, // 11: dutctl.v1.DeviceService.Commands:output_type -> dutctl.v1.CommandsResponse - 5, // 12: dutctl.v1.DeviceService.Run:output_type -> dutctl.v1.RunResponse - 10, // [10:13] is the sub-list for method output_type - 7, // [7:10] is the sub-list for method input_type + 4, // 9: dutctl.v1.DeviceService.Details:input_type -> dutctl.v1.DetailsRequest + 6, // 10: dutctl.v1.DeviceService.Run:input_type -> dutctl.v1.RunRequest + 1, // 11: dutctl.v1.DeviceService.List:output_type -> dutctl.v1.ListResponse + 3, // 12: dutctl.v1.DeviceService.Commands:output_type -> dutctl.v1.CommandsResponse + 5, // 13: dutctl.v1.DeviceService.Details:output_type -> dutctl.v1.DetailsResponse + 7, // 14: dutctl.v1.DeviceService.Run:output_type -> dutctl.v1.RunResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type 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 @@ -904,7 +1033,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*RunRequest); i { + switch v := v.(*DetailsRequest); i { case 0: return &v.state case 1: @@ -916,7 +1045,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*RunResponse); i { + switch v := v.(*DetailsResponse); i { case 0: return &v.state case 1: @@ -928,7 +1057,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*Command); i { + switch v := v.(*RunRequest); i { case 0: return &v.state case 1: @@ -940,7 +1069,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Print); i { + switch v := v.(*RunResponse); i { case 0: return &v.state case 1: @@ -952,7 +1081,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*Console); i { + switch v := v.(*Command); i { case 0: return &v.state case 1: @@ -964,7 +1093,7 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*FileRequest); i { + switch v := v.(*Print); i { case 0: return &v.state case 1: @@ -976,6 +1105,30 @@ func file_dutctl_v1_dutctl_proto_init() { } } file_dutctl_v1_dutctl_proto_msgTypes[10].Exporter = func(v any, i int) any { + switch v := v.(*Console); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dutctl_v1_dutctl_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*FileRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_dutctl_v1_dutctl_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*File); i { case 0: return &v.state @@ -988,18 +1141,18 @@ func file_dutctl_v1_dutctl_proto_init() { } } } - file_dutctl_v1_dutctl_proto_msgTypes[4].OneofWrappers = []any{ + file_dutctl_v1_dutctl_proto_msgTypes[6].OneofWrappers = []any{ (*RunRequest_Command)(nil), (*RunRequest_Console)(nil), (*RunRequest_File)(nil), } - file_dutctl_v1_dutctl_proto_msgTypes[5].OneofWrappers = []any{ + file_dutctl_v1_dutctl_proto_msgTypes[7].OneofWrappers = []any{ (*RunResponse_Print)(nil), (*RunResponse_Console)(nil), (*RunResponse_FileRequest)(nil), (*RunResponse_File)(nil), } - file_dutctl_v1_dutctl_proto_msgTypes[8].OneofWrappers = []any{ + file_dutctl_v1_dutctl_proto_msgTypes[10].OneofWrappers = []any{ (*Console_Stdin)(nil), (*Console_Stdout)(nil), (*Console_Stderr)(nil), @@ -1010,7 +1163,7 @@ func file_dutctl_v1_dutctl_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_dutctl_v1_dutctl_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/protobuf/gen/dutctl/v1/dutctlv1connect/dutctl.connect.go b/protobuf/gen/dutctl/v1/dutctlv1connect/dutctl.connect.go index 875c51c..f7d82f6 100644 --- a/protobuf/gen/dutctl/v1/dutctlv1connect/dutctl.connect.go +++ b/protobuf/gen/dutctl/v1/dutctlv1connect/dutctl.connect.go @@ -37,6 +37,8 @@ const ( DeviceServiceListProcedure = "/dutctl.v1.DeviceService/List" // DeviceServiceCommandsProcedure is the fully-qualified name of the DeviceService's Commands RPC. DeviceServiceCommandsProcedure = "/dutctl.v1.DeviceService/Commands" + // DeviceServiceDetailsProcedure is the fully-qualified name of the DeviceService's Details RPC. + DeviceServiceDetailsProcedure = "/dutctl.v1.DeviceService/Details" // DeviceServiceRunProcedure is the fully-qualified name of the DeviceService's Run RPC. DeviceServiceRunProcedure = "/dutctl.v1.DeviceService/Run" ) @@ -46,6 +48,7 @@ var ( deviceServiceServiceDescriptor = v1.File_dutctl_v1_dutctl_proto.Services().ByName("DeviceService") deviceServiceListMethodDescriptor = deviceServiceServiceDescriptor.Methods().ByName("List") deviceServiceCommandsMethodDescriptor = deviceServiceServiceDescriptor.Methods().ByName("Commands") + deviceServiceDetailsMethodDescriptor = deviceServiceServiceDescriptor.Methods().ByName("Details") deviceServiceRunMethodDescriptor = deviceServiceServiceDescriptor.Methods().ByName("Run") ) @@ -53,6 +56,7 @@ var ( type DeviceServiceClient interface { List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) Commands(context.Context, *connect.Request[v1.CommandsRequest]) (*connect.Response[v1.CommandsResponse], error) + Details(context.Context, *connect.Request[v1.DetailsRequest]) (*connect.Response[v1.DetailsResponse], error) Run(context.Context) *connect.BidiStreamForClient[v1.RunRequest, v1.RunResponse] } @@ -78,6 +82,12 @@ func NewDeviceServiceClient(httpClient connect.HTTPClient, baseURL string, opts connect.WithSchema(deviceServiceCommandsMethodDescriptor), connect.WithClientOptions(opts...), ), + details: connect.NewClient[v1.DetailsRequest, v1.DetailsResponse]( + httpClient, + baseURL+DeviceServiceDetailsProcedure, + connect.WithSchema(deviceServiceDetailsMethodDescriptor), + connect.WithClientOptions(opts...), + ), run: connect.NewClient[v1.RunRequest, v1.RunResponse]( httpClient, baseURL+DeviceServiceRunProcedure, @@ -91,6 +101,7 @@ func NewDeviceServiceClient(httpClient connect.HTTPClient, baseURL string, opts type deviceServiceClient struct { list *connect.Client[v1.ListRequest, v1.ListResponse] commands *connect.Client[v1.CommandsRequest, v1.CommandsResponse] + details *connect.Client[v1.DetailsRequest, v1.DetailsResponse] run *connect.Client[v1.RunRequest, v1.RunResponse] } @@ -104,6 +115,11 @@ func (c *deviceServiceClient) Commands(ctx context.Context, req *connect.Request return c.commands.CallUnary(ctx, req) } +// Details calls dutctl.v1.DeviceService.Details. +func (c *deviceServiceClient) Details(ctx context.Context, req *connect.Request[v1.DetailsRequest]) (*connect.Response[v1.DetailsResponse], error) { + return c.details.CallUnary(ctx, req) +} + // Run calls dutctl.v1.DeviceService.Run. func (c *deviceServiceClient) Run(ctx context.Context) *connect.BidiStreamForClient[v1.RunRequest, v1.RunResponse] { return c.run.CallBidiStream(ctx) @@ -113,6 +129,7 @@ func (c *deviceServiceClient) Run(ctx context.Context) *connect.BidiStreamForCli type DeviceServiceHandler interface { List(context.Context, *connect.Request[v1.ListRequest]) (*connect.Response[v1.ListResponse], error) Commands(context.Context, *connect.Request[v1.CommandsRequest]) (*connect.Response[v1.CommandsResponse], error) + Details(context.Context, *connect.Request[v1.DetailsRequest]) (*connect.Response[v1.DetailsResponse], error) Run(context.Context, *connect.BidiStream[v1.RunRequest, v1.RunResponse]) error } @@ -134,6 +151,12 @@ func NewDeviceServiceHandler(svc DeviceServiceHandler, opts ...connect.HandlerOp connect.WithSchema(deviceServiceCommandsMethodDescriptor), connect.WithHandlerOptions(opts...), ) + deviceServiceDetailsHandler := connect.NewUnaryHandler( + DeviceServiceDetailsProcedure, + svc.Details, + connect.WithSchema(deviceServiceDetailsMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) deviceServiceRunHandler := connect.NewBidiStreamHandler( DeviceServiceRunProcedure, svc.Run, @@ -146,6 +169,8 @@ func NewDeviceServiceHandler(svc DeviceServiceHandler, opts ...connect.HandlerOp deviceServiceListHandler.ServeHTTP(w, r) case DeviceServiceCommandsProcedure: deviceServiceCommandsHandler.ServeHTTP(w, r) + case DeviceServiceDetailsProcedure: + deviceServiceDetailsHandler.ServeHTTP(w, r) case DeviceServiceRunProcedure: deviceServiceRunHandler.ServeHTTP(w, r) default: @@ -165,6 +190,10 @@ func (UnimplementedDeviceServiceHandler) Commands(context.Context, *connect.Requ return nil, connect.NewError(connect.CodeUnimplemented, errors.New("dutctl.v1.DeviceService.Commands is not implemented")) } +func (UnimplementedDeviceServiceHandler) Details(context.Context, *connect.Request[v1.DetailsRequest]) (*connect.Response[v1.DetailsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("dutctl.v1.DeviceService.Details is not implemented")) +} + func (UnimplementedDeviceServiceHandler) Run(context.Context, *connect.BidiStream[v1.RunRequest, v1.RunResponse]) error { return connect.NewError(connect.CodeUnimplemented, errors.New("dutctl.v1.DeviceService.Run is not implemented")) }