This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
plug-sdk/pkg/grpc/plug_grpc.pb.go

286 lines
10 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.12.4
// source: plug.proto
package gRPC
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// 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.
type PlugConnectorClient interface {
TaskStart(ctx context.Context, in *PlugTaskCreation, opts ...grpc.CallOption) (*PlugTaskStatus, error)
TaskStatus(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error)
TaskCancel(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error)
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error)
SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error)
GetUserMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error)
}
type plugConnectorClient struct {
cc grpc.ClientConnInterface
}
func NewPlugConnectorClient(cc grpc.ClientConnInterface) PlugConnectorClient {
return &plugConnectorClient{cc}
}
func (c *plugConnectorClient) TaskStart(ctx context.Context, in *PlugTaskCreation, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, "/PlugConnector/TaskStart", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *plugConnectorClient) TaskStatus(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, "/PlugConnector/TaskStatus", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *plugConnectorClient) TaskCancel(ctx context.Context, in *PlugTask, opts ...grpc.CallOption) (*PlugTaskStatus, error) {
out := new(PlugTaskStatus)
err := c.cc.Invoke(ctx, "/PlugConnector/TaskCancel", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *plugConnectorClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PongResponse, error) {
out := new(PongResponse)
err := c.cc.Invoke(ctx, "/PlugConnector/Ping", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *plugConnectorClient) SendMessage(ctx context.Context, in *SendMessageRequest, opts ...grpc.CallOption) (*SendMessageResponse, error) {
out := new(SendMessageResponse)
err := c.cc.Invoke(ctx, "/PlugConnector/SendMessage", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *plugConnectorClient) GetUserMessages(ctx context.Context, in *GetMessagesRequest, opts ...grpc.CallOption) (*GetMessagesResponse, error) {
out := new(GetMessagesResponse)
err := c.cc.Invoke(ctx, "/PlugConnector/GetUserMessages", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PlugConnectorServer is the server API for PlugConnector service.
// All implementations must embed UnimplementedPlugConnectorServer
// for forward compatibility
type PlugConnectorServer interface {
TaskStart(context.Context, *PlugTaskCreation) (*PlugTaskStatus, error)
TaskStatus(context.Context, *PlugTask) (*PlugTaskStatus, error)
TaskCancel(context.Context, *PlugTask) (*PlugTaskStatus, error)
Ping(context.Context, *PingRequest) (*PongResponse, error)
SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error)
GetUserMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error)
mustEmbedUnimplementedPlugConnectorServer()
}
// UnimplementedPlugConnectorServer must be embedded to have forward compatible implementations.
type UnimplementedPlugConnectorServer struct {
}
func (UnimplementedPlugConnectorServer) TaskStart(context.Context, *PlugTaskCreation) (*PlugTaskStatus, error) {
return nil, status.Errorf(codes.Unimplemented, "method TaskStart not implemented")
}
func (UnimplementedPlugConnectorServer) TaskStatus(context.Context, *PlugTask) (*PlugTaskStatus, error) {
return nil, status.Errorf(codes.Unimplemented, "method TaskStatus not implemented")
}
func (UnimplementedPlugConnectorServer) TaskCancel(context.Context, *PlugTask) (*PlugTaskStatus, error) {
return nil, status.Errorf(codes.Unimplemented, "method TaskCancel not implemented")
}
func (UnimplementedPlugConnectorServer) Ping(context.Context, *PingRequest) (*PongResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedPlugConnectorServer) SendMessage(context.Context, *SendMessageRequest) (*SendMessageResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented")
}
func (UnimplementedPlugConnectorServer) GetUserMessages(context.Context, *GetMessagesRequest) (*GetMessagesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetUserMessages not implemented")
}
func (UnimplementedPlugConnectorServer) mustEmbedUnimplementedPlugConnectorServer() {}
// UnsafePlugConnectorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PlugConnectorServer will
// result in compilation errors.
type UnsafePlugConnectorServer interface {
mustEmbedUnimplementedPlugConnectorServer()
}
func RegisterPlugConnectorServer(s grpc.ServiceRegistrar, srv PlugConnectorServer) {
s.RegisterService(&PlugConnector_ServiceDesc, srv)
}
func _PlugConnector_TaskStart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlugTaskCreation)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).TaskStart(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/TaskStart",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskStart(ctx, req.(*PlugTaskCreation))
}
return interceptor(ctx, in, info, handler)
}
func _PlugConnector_TaskStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlugTask)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).TaskStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/TaskStatus",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskStatus(ctx, req.(*PlugTask))
}
return interceptor(ctx, in, info, handler)
}
func _PlugConnector_TaskCancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlugTask)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).TaskCancel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/TaskCancel",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).TaskCancel(ctx, req.(*PlugTask))
}
return interceptor(ctx, in, info, handler)
}
func _PlugConnector_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PingRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).Ping(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/Ping",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).Ping(ctx, req.(*PingRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PlugConnector_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendMessageRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).SendMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/SendMessage",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).SendMessage(ctx, req.(*SendMessageRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PlugConnector_GetUserMessages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetMessagesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PlugConnectorServer).GetUserMessages(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/PlugConnector/GetUserMessages",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PlugConnectorServer).GetUserMessages(ctx, req.(*GetMessagesRequest))
}
return interceptor(ctx, in, info, handler)
}
// PlugConnector_ServiceDesc is the grpc.ServiceDesc for PlugConnector service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PlugConnector_ServiceDesc = grpc.ServiceDesc{
ServiceName: "PlugConnector",
HandlerType: (*PlugConnectorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "TaskStart",
Handler: _PlugConnector_TaskStart_Handler,
},
{
MethodName: "TaskStatus",
Handler: _PlugConnector_TaskStatus_Handler,
},
{
MethodName: "TaskCancel",
Handler: _PlugConnector_TaskCancel_Handler,
},
{
MethodName: "Ping",
Handler: _PlugConnector_Ping_Handler,
},
{
MethodName: "SendMessage",
Handler: _PlugConnector_SendMessage_Handler,
},
{
MethodName: "GetUserMessages",
Handler: _PlugConnector_GetUserMessages_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "plug.proto",
}