// Code generated by protoc-gen-go.
// source: rce.proto
// DO NOT EDIT!

/*
Package rce is a generated protocol buffer package.

It is generated from these files:
	rce.proto

It has these top-level messages:
	Empty
	Status
	ID
	Command
*/
package pb

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 STATE int32

const (
	STATE_UNKNOWN  STATE = 0
	STATE_PENDING  STATE = 1
	STATE_RUNNING  STATE = 2
	STATE_COMPLETE STATE = 3
	STATE_FAIL     STATE = 4
	STATE_TIMEOUT  STATE = 5
	STATE_STOPPED  STATE = 6
)

var STATE_name = map[int32]string{
	0: "UNKNOWN",
	1: "PENDING",
	2: "RUNNING",
	3: "COMPLETE",
	4: "FAIL",
	5: "TIMEOUT",
	6: "STOPPED",
}
var STATE_value = map[string]int32{
	"UNKNOWN":  0,
	"PENDING":  1,
	"RUNNING":  2,
	"COMPLETE": 3,
	"FAIL":     4,
	"TIMEOUT":  5,
	"STOPPED":  6,
}

func (x STATE) String() string {
	return proto.EnumName(STATE_name, int32(x))
}
func (STATE) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

type Empty struct {
}

func (m *Empty) Reset()                    { *m = Empty{} }
func (m *Empty) String() string            { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage()               {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

type Status struct {
	ID        string   `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	Name      string   `protobuf:"bytes,2,opt,name=Name" json:"Name,omitempty"`
	State     STATE    `protobuf:"varint,3,opt,name=State,enum=rce.STATE" json:"State,omitempty"`
	PID       int64    `protobuf:"varint,4,opt,name=PID" json:"PID,omitempty"`
	StartTime int64    `protobuf:"varint,5,opt,name=StartTime" json:"StartTime,omitempty"`
	StopTime  int64    `protobuf:"varint,6,opt,name=StopTime" json:"StopTime,omitempty"`
	ExitCode  int64    `protobuf:"varint,7,opt,name=ExitCode" json:"ExitCode,omitempty"`
	Args      []string `protobuf:"bytes,8,rep,name=Args" json:"Args,omitempty"`
	Stdout    []string `protobuf:"bytes,9,rep,name=Stdout" json:"Stdout,omitempty"`
	Stderr    []string `protobuf:"bytes,10,rep,name=Stderr" json:"Stderr,omitempty"`
	Error     string   `protobuf:"bytes,11,opt,name=Error" json:"Error,omitempty"`
}

func (m *Status) Reset()                    { *m = Status{} }
func (m *Status) String() string            { return proto.CompactTextString(m) }
func (*Status) ProtoMessage()               {}
func (*Status) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }

func (m *Status) GetID() string {
	if m != nil {
		return m.ID
	}
	return ""
}

func (m *Status) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Status) GetState() STATE {
	if m != nil {
		return m.State
	}
	return STATE_UNKNOWN
}

func (m *Status) GetPID() int64 {
	if m != nil {
		return m.PID
	}
	return 0
}

func (m *Status) GetStartTime() int64 {
	if m != nil {
		return m.StartTime
	}
	return 0
}

func (m *Status) GetStopTime() int64 {
	if m != nil {
		return m.StopTime
	}
	return 0
}

func (m *Status) GetExitCode() int64 {
	if m != nil {
		return m.ExitCode
	}
	return 0
}

func (m *Status) GetArgs() []string {
	if m != nil {
		return m.Args
	}
	return nil
}

func (m *Status) GetStdout() []string {
	if m != nil {
		return m.Stdout
	}
	return nil
}

func (m *Status) GetStderr() []string {
	if m != nil {
		return m.Stderr
	}
	return nil
}

func (m *Status) GetError() string {
	if m != nil {
		return m.Error
	}
	return ""
}

type ID struct {
	ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
}

func (m *ID) Reset()                    { *m = ID{} }
func (m *ID) String() string            { return proto.CompactTextString(m) }
func (*ID) ProtoMessage()               {}
func (*ID) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }

func (m *ID) GetID() string {
	if m != nil {
		return m.ID
	}
	return ""
}

type Command struct {
	Name      string   `protobuf:"bytes,1,opt,name=Name" json:"Name,omitempty"`
	Arguments []string `protobuf:"bytes,2,rep,name=Arguments" json:"Arguments,omitempty"`
}

func (m *Command) Reset()                    { *m = Command{} }
func (m *Command) String() string            { return proto.CompactTextString(m) }
func (*Command) ProtoMessage()               {}
func (*Command) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }

func (m *Command) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Command) GetArguments() []string {
	if m != nil {
		return m.Arguments
	}
	return nil
}

func init() {
	proto.RegisterType((*Empty)(nil), "rce.Empty")
	proto.RegisterType((*Status)(nil), "rce.Status")
	proto.RegisterType((*ID)(nil), "rce.ID")
	proto.RegisterType((*Command)(nil), "rce.Command")
	proto.RegisterEnum("rce.STATE", STATE_name, STATE_value)
}

// 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 RCEAgent service

type RCEAgentClient interface {
	// Start a command and immediately return its ID. Be sure to call Wait or Stop
	// to reap the command, else the agent will effectively leak memory by holding
	// unreaped commands. A command is considered running until reaped.
	Start(ctx context.Context, in *Command, opts ...grpc.CallOption) (*ID, error)
	// Wait for a command to complete or be stopped, reap it, and return its final status.
	Wait(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Status, error)
	// Get the status of a command if it hasn't been reaped by calling Wait or Stop.
	GetStatus(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Status, error)
	// Stop then reap a command by sending it a SIGTERM signal.
	Stop(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Empty, error)
	// Return a list of all running (not reaped) commands by ID.
	Running(ctx context.Context, in *Empty, opts ...grpc.CallOption) (RCEAgent_RunningClient, error)
}

type rCEAgentClient struct {
	cc *grpc.ClientConn
}

func NewRCEAgentClient(cc *grpc.ClientConn) RCEAgentClient {
	return &rCEAgentClient{cc}
}

func (c *rCEAgentClient) Start(ctx context.Context, in *Command, opts ...grpc.CallOption) (*ID, error) {
	out := new(ID)
	err := grpc.Invoke(ctx, "/rce.RCEAgent/Start", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rCEAgentClient) Wait(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Status, error) {
	out := new(Status)
	err := grpc.Invoke(ctx, "/rce.RCEAgent/Wait", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rCEAgentClient) GetStatus(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Status, error) {
	out := new(Status)
	err := grpc.Invoke(ctx, "/rce.RCEAgent/GetStatus", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rCEAgentClient) Stop(ctx context.Context, in *ID, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := grpc.Invoke(ctx, "/rce.RCEAgent/Stop", in, out, c.cc, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *rCEAgentClient) Running(ctx context.Context, in *Empty, opts ...grpc.CallOption) (RCEAgent_RunningClient, error) {
	stream, err := grpc.NewClientStream(ctx, &_RCEAgent_serviceDesc.Streams[0], c.cc, "/rce.RCEAgent/Running", opts...)
	if err != nil {
		return nil, err
	}
	x := &rCEAgentRunningClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type RCEAgent_RunningClient interface {
	Recv() (*ID, error)
	grpc.ClientStream
}

type rCEAgentRunningClient struct {
	grpc.ClientStream
}

func (x *rCEAgentRunningClient) Recv() (*ID, error) {
	m := new(ID)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Server API for RCEAgent service

type RCEAgentServer interface {
	// Start a command and immediately return its ID. Be sure to call Wait or Stop
	// to reap the command, else the agent will effectively leak memory by holding
	// unreaped commands. A command is considered running until reaped.
	Start(context.Context, *Command) (*ID, error)
	// Wait for a command to complete or be stopped, reap it, and return its final status.
	Wait(context.Context, *ID) (*Status, error)
	// Get the status of a command if it hasn't been reaped by calling Wait or Stop.
	GetStatus(context.Context, *ID) (*Status, error)
	// Stop then reap a command by sending it a SIGTERM signal.
	Stop(context.Context, *ID) (*Empty, error)
	// Return a list of all running (not reaped) commands by ID.
	Running(*Empty, RCEAgent_RunningServer) error
}

func RegisterRCEAgentServer(s *grpc.Server, srv RCEAgentServer) {
	s.RegisterService(&_RCEAgent_serviceDesc, srv)
}

func _RCEAgent_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Command)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RCEAgentServer).Start(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rce.RCEAgent/Start",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RCEAgentServer).Start(ctx, req.(*Command))
	}
	return interceptor(ctx, in, info, handler)
}

func _RCEAgent_Wait_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ID)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RCEAgentServer).Wait(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rce.RCEAgent/Wait",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RCEAgentServer).Wait(ctx, req.(*ID))
	}
	return interceptor(ctx, in, info, handler)
}

func _RCEAgent_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ID)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RCEAgentServer).GetStatus(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rce.RCEAgent/GetStatus",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RCEAgentServer).GetStatus(ctx, req.(*ID))
	}
	return interceptor(ctx, in, info, handler)
}

func _RCEAgent_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ID)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RCEAgentServer).Stop(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/rce.RCEAgent/Stop",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RCEAgentServer).Stop(ctx, req.(*ID))
	}
	return interceptor(ctx, in, info, handler)
}

func _RCEAgent_Running_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(RCEAgentServer).Running(m, &rCEAgentRunningServer{stream})
}

type RCEAgent_RunningServer interface {
	Send(*ID) error
	grpc.ServerStream
}

type rCEAgentRunningServer struct {
	grpc.ServerStream
}

func (x *rCEAgentRunningServer) Send(m *ID) error {
	return x.ServerStream.SendMsg(m)
}

var _RCEAgent_serviceDesc = grpc.ServiceDesc{
	ServiceName: "rce.RCEAgent",
	HandlerType: (*RCEAgentServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Start",
			Handler:    _RCEAgent_Start_Handler,
		},
		{
			MethodName: "Wait",
			Handler:    _RCEAgent_Wait_Handler,
		},
		{
			MethodName: "GetStatus",
			Handler:    _RCEAgent_GetStatus_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _RCEAgent_Stop_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Running",
			Handler:       _RCEAgent_Running_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "rce.proto",
}

func init() { proto.RegisterFile("rce.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 422 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6a, 0xdb, 0x40,
	0x10, 0xc6, 0xbd, 0xfa, 0x63, 0x49, 0xe3, 0x10, 0xc4, 0x10, 0xca, 0x62, 0xd2, 0x22, 0xd4, 0x8b,
	0xe9, 0x21, 0x94, 0xf4, 0xd8, 0x93, 0xb0, 0xb6, 0x41, 0x34, 0x59, 0x0b, 0x49, 0x26, 0xd7, 0xaa,
	0xf1, 0x62, 0x74, 0x90, 0x64, 0xd6, 0x2b, 0x68, 0xdf, 0xa2, 0x0f, 0xd3, 0x07, 0x2c, 0xbb, 0x52,
	0x6c, 0x53, 0xc8, 0x6d, 0x7e, 0xdf, 0x37, 0x48, 0xb3, 0x33, 0x1f, 0x04, 0xf2, 0x45, 0xdc, 0x1d,
	0x64, 0xaf, 0x7a, 0xb4, 0xe5, 0x8b, 0x88, 0x3d, 0x70, 0x59, 0x7b, 0x50, 0xbf, 0xe3, 0x3f, 0x16,
	0xcc, 0x4b, 0x55, 0xab, 0xe1, 0x88, 0xd7, 0x60, 0x65, 0x29, 0x25, 0x11, 0x59, 0x05, 0x85, 0x95,
	0xa5, 0x88, 0xe0, 0xf0, 0xba, 0x15, 0xd4, 0x32, 0x8a, 0xa9, 0x31, 0x02, 0x57, 0x77, 0x0b, 0x6a,
	0x47, 0x64, 0x75, 0x7d, 0x0f, 0x77, 0xfa, 0xbb, 0x65, 0x95, 0x54, 0xac, 0x18, 0x0d, 0x0c, 0xc1,
	0xce, 0xb3, 0x94, 0x3a, 0x11, 0x59, 0xd9, 0x85, 0x2e, 0xf1, 0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