mirror of https://github.com/ouqiang/gocron
177 lines
5.3 KiB
Go
177 lines
5.3 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: task.proto
|
|
|
|
/*
|
|
Package rpc is a generated protocol buffer package.
|
|
|
|
It is generated from these files:
|
|
task.proto
|
|
|
|
It has these top-level messages:
|
|
TaskRequest
|
|
TaskResponse
|
|
*/
|
|
package rpc
|
|
|
|
import proto "github.com/golang/protobuf/proto"
|
|
import fmt "fmt"
|
|
import math "math"
|
|
|
|
import (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
|
|
|
|
type TaskRequest struct {
|
|
Command string `protobuf:"bytes,2,opt,name=command" json:"command,omitempty"`
|
|
Timeout int32 `protobuf:"varint,3,opt,name=timeout" json:"timeout,omitempty"`
|
|
}
|
|
|
|
func (m *TaskRequest) Reset() { *m = TaskRequest{} }
|
|
func (m *TaskRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*TaskRequest) ProtoMessage() {}
|
|
func (*TaskRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
|
|
|
func (m *TaskRequest) GetCommand() string {
|
|
if m != nil {
|
|
return m.Command
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TaskRequest) GetTimeout() int32 {
|
|
if m != nil {
|
|
return m.Timeout
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type TaskResponse struct {
|
|
Output string `protobuf:"bytes,1,opt,name=output" json:"output,omitempty"`
|
|
Error string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
|
|
}
|
|
|
|
func (m *TaskResponse) Reset() { *m = TaskResponse{} }
|
|
func (m *TaskResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*TaskResponse) ProtoMessage() {}
|
|
func (*TaskResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
|
|
|
func (m *TaskResponse) GetOutput() string {
|
|
if m != nil {
|
|
return m.Output
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *TaskResponse) GetError() string {
|
|
if m != nil {
|
|
return m.Error
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*TaskRequest)(nil), "rpc.TaskRequest")
|
|
proto.RegisterType((*TaskResponse)(nil), "rpc.TaskResponse")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for Task service
|
|
|
|
type TaskClient interface {
|
|
Run(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error)
|
|
}
|
|
|
|
type taskClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewTaskClient(cc *grpc.ClientConn) TaskClient {
|
|
return &taskClient{cc}
|
|
}
|
|
|
|
func (c *taskClient) Run(ctx context.Context, in *TaskRequest, opts ...grpc.CallOption) (*TaskResponse, error) {
|
|
out := new(TaskResponse)
|
|
err := grpc.Invoke(ctx, "/rpc.Task/Run", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for Task service
|
|
|
|
type TaskServer interface {
|
|
Run(context.Context, *TaskRequest) (*TaskResponse, error)
|
|
}
|
|
|
|
func RegisterTaskServer(s *grpc.Server, srv TaskServer) {
|
|
s.RegisterService(&_Task_serviceDesc, srv)
|
|
}
|
|
|
|
func _Task_Run_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(TaskRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(TaskServer).Run(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/rpc.Task/Run",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(TaskServer).Run(ctx, req.(*TaskRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Task_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "rpc.Task",
|
|
HandlerType: (*TaskServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Run",
|
|
Handler: _Task_Run_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "task.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("task.proto", fileDescriptor0) }
|
|
|
|
var fileDescriptor0 = []byte{
|
|
// 170 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x8f, 0xb1, 0x0e, 0x82, 0x40,
|
|
0x0c, 0x86, 0x45, 0x04, 0x63, 0x75, 0xd0, 0xc6, 0x98, 0x8b, 0x13, 0x61, 0x62, 0x30, 0x0c, 0xea,
|
|
0xe8, 0xe2, 0x2b, 0x5c, 0x7c, 0x01, 0xc4, 0x1b, 0x0c, 0x81, 0x9e, 0xbd, 0xde, 0xfb, 0x1b, 0x38,
|
|
0x48, 0x18, 0xbf, 0x36, 0xfd, 0xfa, 0xff, 0x00, 0x52, 0xb9, 0xa6, 0xb4, 0x4c, 0x42, 0x18, 0xb3,
|
|
0xad, 0xf3, 0x27, 0x6c, 0x5f, 0x95, 0x6b, 0xb4, 0xf9, 0x79, 0xe3, 0x04, 0x15, 0xac, 0x6b, 0x6a,
|
|
0xdb, 0xaa, 0xfb, 0xa8, 0x65, 0x16, 0x15, 0x1b, 0x3d, 0x61, 0xbf, 0x91, 0x6f, 0x6b, 0xc8, 0x8b,
|
|
0x8a, 0xb3, 0xa8, 0x48, 0xf4, 0x84, 0xf9, 0x03, 0x76, 0x41, 0xe1, 0x2c, 0x75, 0xce, 0xe0, 0x09,
|
|
0x52, 0xf2, 0x62, 0xbd, 0xa8, 0x68, 0x50, 0x8c, 0x84, 0x47, 0x48, 0x0c, 0x33, 0xf1, 0x68, 0x0e,
|
|
0x70, 0xbd, 0xc3, 0xaa, 0xbf, 0xc6, 0x0b, 0xc4, 0xda, 0x77, 0xb8, 0x2f, 0xd9, 0xd6, 0xe5, 0x2c,
|
|
0xd2, 0xf9, 0x30, 0x9b, 0x84, 0x0f, 0xf9, 0xe2, 0x9d, 0x0e, 0x15, 0x6e, 0xff, 0x00, 0x00, 0x00,
|
|
0xff, 0xff, 0xef, 0x3c, 0x71, 0x6b, 0xd0, 0x00, 0x00, 0x00,
|
|
}
|