2017-05-26 10:09:07 +00:00
|
|
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
2017-05-25 14:32:40 +00:00
|
|
|
// 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 {
|
2017-05-26 10:09:07 +00:00
|
|
|
Command string `protobuf:"bytes,2,opt,name=command" json:"command,omitempty"`
|
|
|
|
Timeout int32 `protobuf:"varint,3,opt,name=timeout" json:"timeout,omitempty"`
|
2017-05-25 14:32:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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} }
|
|
|
|
|
2017-05-26 10:09:07 +00:00
|
|
|
func (m *TaskRequest) GetCommand() string {
|
2017-05-25 14:32:40 +00:00
|
|
|
if m != nil {
|
2017-05-26 10:09:07 +00:00
|
|
|
return m.Command
|
2017-05-25 14:32:40 +00:00
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2017-05-26 10:09:07 +00:00
|
|
|
func (m *TaskRequest) GetTimeout() int32 {
|
|
|
|
if m != nil {
|
|
|
|
return m.Timeout
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2017-05-25 14:32:40 +00:00
|
|
|
type TaskResponse struct {
|
2017-05-26 10:09:07 +00:00
|
|
|
Output string `protobuf:"bytes,1,opt,name=output" json:"output,omitempty"`
|
2017-05-25 14:32:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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} }
|
|
|
|
|
2017-05-26 10:09:07 +00:00
|
|
|
func (m *TaskResponse) GetOutput() string {
|
2017-05-25 14:32:40 +00:00
|
|
|
if m != nil {
|
2017-05-26 10:09:07 +00:00
|
|
|
return m.Output
|
2017-05-25 14:32:40 +00:00
|
|
|
}
|
|
|
|
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{
|
2017-05-26 10:09:07 +00:00
|
|
|
// 157 bytes of a gzipped FileDescriptorProto
|
2017-05-25 14:32:40 +00:00
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x49, 0x2c, 0xce,
|
2017-05-26 10:09:07 +00:00
|
|
|
0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x2e, 0x2a, 0x48, 0x56, 0x72, 0xe4, 0xe2, 0x0e,
|
|
|
|
0x49, 0x2c, 0xce, 0x0e, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x92, 0xe0, 0x62, 0x4f, 0xce,
|
|
|
|
0xcf, 0xcd, 0x4d, 0xcc, 0x4b, 0x91, 0x60, 0x52, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0x71, 0x41, 0x32,
|
|
|
|
0x25, 0x99, 0xb9, 0xa9, 0xf9, 0xa5, 0x25, 0x12, 0xcc, 0x0a, 0x8c, 0x1a, 0xac, 0x41, 0x30, 0xae,
|
|
|
|
0x92, 0x1a, 0x17, 0x0f, 0xc4, 0x88, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0x21, 0x31, 0x2e, 0xb6,
|
|
|
|
0xfc, 0xd2, 0x92, 0x82, 0xd2, 0x12, 0x09, 0x46, 0xb0, 0x11, 0x50, 0x9e, 0x91, 0x09, 0x17, 0x0b,
|
|
|
|
0x48, 0x9d, 0x90, 0x0e, 0x17, 0x73, 0x50, 0x69, 0x9e, 0x90, 0x80, 0x5e, 0x51, 0x41, 0xb2, 0x1e,
|
|
|
|
0x92, 0xe5, 0x52, 0x82, 0x48, 0x22, 0x10, 0xb3, 0x94, 0x18, 0x92, 0xd8, 0xc0, 0x8e, 0x35, 0x06,
|
|
|
|
0x04, 0x00, 0x00, 0xff, 0xff, 0x82, 0x08, 0x5d, 0x10, 0xba, 0x00, 0x00, 0x00,
|
2017-05-25 14:32:40 +00:00
|
|
|
}
|