V2 #2

Merged
fenpaws merged 13 commits from V2 into main 2024-07-08 13:42:14 +00:00
3 changed files with 29 additions and 36 deletions
Showing only changes of commit 73838c26e2 - Show all commits

View File

@ -1,15 +1,15 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.32.0 // protoc-gen-go v1.28.1
// protoc v3.19.6 // protoc v3.12.4
// source: plug.proto // source: plug.proto
package gRPC package gRPC
import ( import (
timestamp "github.com/golang/protobuf/ptypes/timestamp"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
) )
@ -79,7 +79,7 @@ type PingRequest struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Optional message field, can be removed if not needed Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Optional message field, can be removed if not needed
Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
} }
func (x *PingRequest) Reset() { func (x *PingRequest) Reset() {
@ -121,7 +121,7 @@ func (x *PingRequest) GetMessage() string {
return "" return ""
} }
func (x *PingRequest) GetTimestamp() *timestamppb.Timestamp { func (x *PingRequest) GetTimestamp() *timestamp.Timestamp {
if x != nil { if x != nil {
return x.Timestamp return x.Timestamp
} }
@ -134,7 +134,7 @@ type PongResponse struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Optional message field, can be removed if not needed Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Optional message field, can be removed if not needed
Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Timestamp *timestamp.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
} }
func (x *PongResponse) Reset() { func (x *PongResponse) Reset() {
@ -176,7 +176,7 @@ func (x *PongResponse) GetMessage() string {
return "" return ""
} }
func (x *PongResponse) GetTimestamp() *timestamppb.Timestamp { func (x *PongResponse) GetTimestamp() *timestamp.Timestamp {
if x != nil { if x != nil {
return x.Timestamp return x.Timestamp
} }
@ -425,7 +425,7 @@ var file_plug_proto_goTypes = []interface{}{
(*PlugTaskStatus)(nil), // 3: PlugTaskStatus (*PlugTaskStatus)(nil), // 3: PlugTaskStatus
(*PlugTask)(nil), // 4: PlugTask (*PlugTask)(nil), // 4: PlugTask
(*PlugTaskCreation)(nil), // 5: PlugTaskCreation (*PlugTaskCreation)(nil), // 5: PlugTaskCreation
(*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp (*timestamp.Timestamp)(nil), // 6: google.protobuf.Timestamp
} }
var file_plug_proto_depIdxs = []int32{ var file_plug_proto_depIdxs = []int32{
6, // 0: PingRequest.timestamp:type_name -> google.protobuf.Timestamp 6, // 0: PingRequest.timestamp:type_name -> google.protobuf.Timestamp

View File

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.3.0 // - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.6 // - protoc v3.12.4
// source: plug.proto // source: plug.proto
package gRPC package gRPC
@ -18,13 +18,6 @@ import (
// Requires gRPC-Go v1.32.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7 const _ = grpc.SupportPackageIsVersion7
const (
PlugConnector_TaskStart_FullMethodName = "/PlugConnector/TaskStart"
PlugConnector_TaskStatus_FullMethodName = "/PlugConnector/TaskStatus"
PlugConnector_TaskCancel_FullMethodName = "/PlugConnector/TaskCancel"
PlugConnector_Ping_FullMethodName = "/PlugConnector/Ping"
)
// PlugConnectorClient is the client API for PlugConnector service. // PlugConnectorClient is the client API for PlugConnector service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
@ -45,7 +38,7 @@ func NewPlugConnectorClient(cc grpc.ClientConnInterface) PlugConnectorClient {
func (c *plugConnectorClient) TaskStart(ctx context.Context, in *PlugTaskCreation, opts ...grpc.CallOption) (*PlugTaskStatus, error) { func (c *plugConnectorClient) TaskStart(ctx context.Context, in *PlugTaskCreation, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus) out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, PlugConnector_TaskStart_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, "/PlugConnector/TaskStart", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -54,7 +47,7 @@ func (c *plugConnectorClient) TaskStart(ctx context.Context, in *PlugTaskCreatio
func (c *plugConnectorClient) TaskStatus(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) { func (c *plugConnectorClient) TaskStatus(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus) out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, PlugConnector_TaskStatus_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, "/PlugConnector/TaskStatus", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -63,7 +56,7 @@ func (c *plugConnectorClient) TaskStatus(ctx context.Context, in *PlugTask, opts
func (c *plugConnectorClient) TaskCancel(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) { func (c *plugConnectorClient) TaskCancel(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus) out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, PlugConnector_TaskCancel_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, "/PlugConnector/TaskCancel", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -72,7 +65,7 @@ func (c *plugConnectorClient) TaskCancel(ctx context.Context, in *PlugTask, opts
func (c *plugConnectorClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) { func (c *plugConnectorClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) {
out := new(PongResponse) out := new(PongResponse)
err := c.cc.Invoke(ctx, PlugConnector_Ping_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, "/PlugConnector/Ping", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -129,7 +122,7 @@ func _PlugConnector_TaskStart_Handler(srv interface{}, ctx context.Context, dec
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: PlugConnector_TaskStart_FullMethodName, FullMethod: "/PlugConnector/TaskStart",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskStart(ctx, req.(*PlugTaskCreation)) return srv.(PlugConnectorServer).TaskStart(ctx, req.(*PlugTaskCreation))
@ -147,7 +140,7 @@ func _PlugConnector_TaskStatus_Handler(srv interface{}, ctx context.Context, dec
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: PlugConnector_TaskStatus_FullMethodName, FullMethod: "/PlugConnector/TaskStatus",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskStatus(ctx, req.(*PlugTask)) return srv.(PlugConnectorServer).TaskStatus(ctx, req.(*PlugTask))
@ -165,7 +158,7 @@ func _PlugConnector_TaskCancel_Handler(srv interface{}, ctx context.Context, dec
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: PlugConnector_TaskCancel_FullMethodName, FullMethod: "/PlugConnector/TaskCancel",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskCancel(ctx, req.(*PlugTask)) return srv.(PlugConnectorServer).TaskCancel(ctx, req.(*PlugTask))
@ -183,7 +176,7 @@ func _PlugConnector_Ping_Handler(srv interface{}, ctx context.Context, dec func(
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: PlugConnector_Ping_FullMethodName, FullMethod: "/PlugConnector/Ping",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).Ping(ctx, req.(*PingRequest)) return srv.(PlugConnectorServer).Ping(ctx, req.(*PingRequest))

View File

@ -7,9 +7,9 @@ To generate the gRPC files you need to do the following:
1. You need to install the [gRPC Compiler](https://grpc.io/docs/protoc-installation/) 1. You need to install the [gRPC Compiler](https://grpc.io/docs/protoc-installation/)
2. Install the Golang Plugin for the compiler 2. Install the Golang Plugin for the compiler
````bash ````bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
```` go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
``````
## Generate: ## Generate:
1. Download the Git submodules (if you didn't clone this repo with ``git clone --recurse-submodules``) 1. Download the Git submodules (if you didn't clone this repo with ``git clone --recurse-submodules``)
```bash ```bash