pb

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

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

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) Descriptor() ([]byte, []int)

func (*Command) GetArguments

func (m *Command) GetArguments() []string

func (*Command) GetName

func (m *Command) GetName() string

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) Reset

func (m *Command) Reset()

func (*Command) String

func (m *Command) String() string

type Empty

type Empty struct {
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type ID

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

func (*ID) Descriptor

func (*ID) Descriptor() ([]byte, []int)

func (*ID) GetID

func (m *ID) GetID() string

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) Reset

func (m *ID) Reset()

func (*ID) String

func (m *ID) String() string

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 STATE

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
)

func (STATE) EnumDescriptor

func (STATE) EnumDescriptor() ([]byte, []int)

func (STATE) String

func (x STATE) String() string

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) Descriptor() ([]byte, []int)

func (*Status) GetArgs

func (m *Status) GetArgs() []string

func (*Status) GetError

func (m *Status) GetError() string

func (*Status) GetExitCode

func (m *Status) GetExitCode() int64

func (*Status) GetID

func (m *Status) GetID() string

func (*Status) GetName

func (m *Status) GetName() string

func (*Status) GetPID

func (m *Status) GetPID() int64

func (*Status) GetStartTime

func (m *Status) GetStartTime() int64

func (*Status) GetState

func (m *Status) GetState() STATE

func (*Status) GetStderr

func (m *Status) GetStderr() []string

func (*Status) GetStdout

func (m *Status) GetStdout() []string

func (*Status) GetStopTime

func (m *Status) GetStopTime() int64

func (*Status) Print

func (s *Status) Print()

Prints cmd status to stdout. A useful debugging tool.

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) String

func (m *Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL