Documentation
¶
Overview ¶
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
Index ¶
- Variables
- func RegisterRCEAgentServer(s *grpc.Server, srv RCEAgentServer)
- type Command
- type Empty
- type ID
- type RCEAgentClient
- type RCEAgentServer
- type RCEAgent_RunningClient
- type RCEAgent_RunningServer
- type STATE
- type Status
- func (*Status) Descriptor() ([]byte, []int)
- func (m *Status) GetArgs() []string
- func (m *Status) GetError() string
- func (m *Status) GetExitCode() int64
- func (m *Status) GetID() string
- func (m *Status) GetName() string
- func (m *Status) GetPID() int64
- func (m *Status) GetStartTime() int64
- func (m *Status) GetState() STATE
- func (m *Status) GetStderr() []string
- func (m *Status) GetStdout() []string
- func (m *Status) GetStopTime() int64
- func (s *Status) Print()
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var STATE_name = map[int32]string{
0: "UNKNOWN",
1: "PENDING",
2: "RUNNING",
3: "COMPLETE",
4: "FAIL",
5: "TIMEOUT",
6: "STOPPED",
}
View Source
var STATE_value = map[string]int32{
"UNKNOWN": 0,
"PENDING": 1,
"RUNNING": 2,
"COMPLETE": 3,
"FAIL": 4,
"TIMEOUT": 5,
"STOPPED": 6,
}
Functions ¶
func RegisterRCEAgentServer ¶
func RegisterRCEAgentServer(s *grpc.Server, srv RCEAgentServer)
Types ¶
type Command ¶
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 (*Command) Descriptor ¶
func (*Command) GetArguments ¶
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
type Empty ¶
type Empty struct {
}
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type ID ¶
type ID struct {
ID string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
}
func (*ID) Descriptor ¶
func (*ID) ProtoMessage ¶
func (*ID) ProtoMessage()
type RCEAgentClient ¶
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)
}
func NewRCEAgentClient ¶
func NewRCEAgentClient(cc *grpc.ClientConn) RCEAgentClient
type RCEAgentServer ¶
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
}
type RCEAgent_RunningClient ¶
type RCEAgent_RunningClient interface {
Recv() (*ID, error)
grpc.ClientStream
}
type RCEAgent_RunningServer ¶
type RCEAgent_RunningServer interface {
Send(*ID) error
grpc.ServerStream
}
type Status ¶
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 (*Status) Descriptor ¶
func (*Status) GetExitCode ¶
func (*Status) GetStartTime ¶
func (*Status) GetStopTime ¶
func (*Status) Print ¶
func (s *Status) Print()
Prints cmd status to stdout. A useful debugging tool.
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.