viceroypb

package
v0.0.0-...-d39c007 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Stream_name = map[int32]string{
		0: "STREAM_UNKNOWN",
		1: "STREAM_STDOUT",
		2: "STREAM_STDERR",
	}
	Stream_value = map[string]int32{
		"STREAM_UNKNOWN": 0,
		"STREAM_STDOUT":  1,
		"STREAM_STDERR":  2,
	}
)

Enum value maps for Stream.

View Source
var (
	CommandState_name = map[int32]string{
		0: "COMMAND_STATE_INVALID",
		1: "COMMAND_STATE_CREATED",
		2: "COMMAND_STATE_RUNNING",
		3: "COMMAND_STATE_EXITED",
		4: "COMMAND_STATE_ABORTED",
		5: "COMMAND_STATE_FAILED",
	}
	CommandState_value = map[string]int32{
		"COMMAND_STATE_INVALID": 0,
		"COMMAND_STATE_CREATED": 1,
		"COMMAND_STATE_RUNNING": 2,
		"COMMAND_STATE_EXITED":  3,
		"COMMAND_STATE_ABORTED": 4,
		"COMMAND_STATE_FAILED":  5,
	}
)

Enum value maps for CommandState.

View Source
var File_compiler_proto protoreflect.FileDescriptor
View Source
var Runner_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "viceroy.v1.Runner",
	HandlerType: (*RunnerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateCommand",
			Handler:    _Runner_CreateCommand_Handler,
		},
		{
			MethodName: "StartCommand",
			Handler:    _Runner_StartCommand_Handler,
		},
		{
			MethodName: "DeleteCommand",
			Handler:    _Runner_DeleteCommand_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TailCommand",
			Handler:       _Runner_TailCommand_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "compiler.proto",
}

Runner_ServiceDesc is the grpc.ServiceDesc for Runner service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterRunnerServer

func RegisterRunnerServer(s grpc.ServiceRegistrar, srv RunnerServer)

Types

type CommandHandle

type CommandHandle struct {

	// Internal ID of the handle.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandHandle) Descriptor deprecated

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

Deprecated: Use CommandHandle.ProtoReflect.Descriptor instead.

func (*CommandHandle) GetId

func (x *CommandHandle) GetId() string

func (*CommandHandle) ProtoMessage

func (*CommandHandle) ProtoMessage()

func (*CommandHandle) ProtoReflect

func (x *CommandHandle) ProtoReflect() protoreflect.Message

func (*CommandHandle) Reset

func (x *CommandHandle) Reset()

func (*CommandHandle) String

func (x *CommandHandle) String() string

type CommandRequest

type CommandRequest struct {

	// The name of the command to execute, e.g., clang.
	Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	// Arguments passed to the compilation. The program name is not included.
	Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// The environment passed to the compilation. Should be provided in key=value
	// form. This specifies the full set of environment variables used when
	// invoking the compiler.
	Environ []string `protobuf:"bytes,3,rep,name=environ,proto3" json:"environ,omitempty"`
	// The working directory to use for the command.
	Wd string `protobuf:"bytes,4,opt,name=wd,proto3" json:"wd,omitempty"`
	// contains filtered or unexported fields
}

CommandRequest executes a command.

func (*CommandRequest) Descriptor deprecated

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

Deprecated: Use CommandRequest.ProtoReflect.Descriptor instead.

func (*CommandRequest) GetArgs

func (x *CommandRequest) GetArgs() []string

func (*CommandRequest) GetCommand

func (x *CommandRequest) GetCommand() string

func (*CommandRequest) GetEnviron

func (x *CommandRequest) GetEnviron() []string

func (*CommandRequest) GetWd

func (x *CommandRequest) GetWd() string

func (*CommandRequest) ProtoMessage

func (*CommandRequest) ProtoMessage()

func (*CommandRequest) ProtoReflect

func (x *CommandRequest) ProtoReflect() protoreflect.Message

func (*CommandRequest) Reset

func (x *CommandRequest) Reset()

func (*CommandRequest) String

func (x *CommandRequest) String() string

type CommandState

type CommandState int32
const (
	// Invalid CommandState.
	CommandState_COMMAND_STATE_INVALID CommandState = 0
	// The command has been created but not started.
	CommandState_COMMAND_STATE_CREATED CommandState = 1
	// The command has been started but is still running.
	CommandState_COMMAND_STATE_RUNNING CommandState = 2
	// The command has completed.
	CommandState_COMMAND_STATE_EXITED CommandState = 3
	// The command was aborted.
	CommandState_COMMAND_STATE_ABORTED CommandState = 4
	// The command failed.
	CommandState_COMMAND_STATE_FAILED CommandState = 5
)

func (CommandState) Descriptor

func (CommandState) Enum

func (x CommandState) Enum() *CommandState

func (CommandState) EnumDescriptor deprecated

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

Deprecated: Use CommandState.Descriptor instead.

func (CommandState) Number

func (CommandState) String

func (x CommandState) String() string

func (CommandState) Type

type CommandStatus

type CommandStatus struct {

	// The request associated with the handle.
	Request *CommandRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// State of the command.
	State CommandState `protobuf:"varint,2,opt,name=state,proto3,enum=viceroy.v1.CommandState" json:"state,omitempty"`
	// Set to the exit code of the program once the command has exited.
	ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// contains filtered or unexported fields
}

func (*CommandStatus) Descriptor deprecated

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

Deprecated: Use CommandStatus.ProtoReflect.Descriptor instead.

func (*CommandStatus) GetExitCode

func (x *CommandStatus) GetExitCode() int32

func (*CommandStatus) GetRequest

func (x *CommandStatus) GetRequest() *CommandRequest

func (*CommandStatus) GetState

func (x *CommandStatus) GetState() CommandState

func (*CommandStatus) ProtoMessage

func (*CommandStatus) ProtoMessage()

func (*CommandStatus) ProtoReflect

func (x *CommandStatus) ProtoReflect() protoreflect.Message

func (*CommandStatus) Reset

func (x *CommandStatus) Reset()

func (*CommandStatus) String

func (x *CommandStatus) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

Empty message to use for messages that don't yet need any fields.

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type RunnerClient

type RunnerClient interface {
	// CreateCommand creates a new, unstarted command to execute. Commands are
	// identified by a handle. Commands may be started by calling StartCommand.
	CreateCommand(ctx context.Context, in *CommandRequest, opts ...grpc.CallOption) (*CommandHandle, error)
	// TailCommand tails output of a command. TailCommand may be called at any
	// point before, during, or after a command executes.
	//
	// The returned stream will always contain the full output from the
	// beginning. The returned stream will be closed once the compilation is
	// finished and all data has been sent.
	TailCommand(ctx context.Context, in *CommandHandle, opts ...grpc.CallOption) (Runner_TailCommandClient, error)
	// StartCommand starts execution of a command, returning once it completes.
	StartCommand(ctx context.Context, in *CommandHandle, opts ...grpc.CallOption) (*CommandStatus, error)
	// DeleteCommand removes a command. If the command is currently running, it
	// will be aborted. DeleteCommand must be called for every command once the
	// output is no longer needed.
	DeleteCommand(ctx context.Context, in *CommandHandle, opts ...grpc.CallOption) (*Empty, error)
}

RunnerClient is the client API for Runner service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewRunnerClient

func NewRunnerClient(cc grpc.ClientConnInterface) RunnerClient

type RunnerServer

type RunnerServer interface {
	// CreateCommand creates a new, unstarted command to execute. Commands are
	// identified by a handle. Commands may be started by calling StartCommand.
	CreateCommand(context.Context, *CommandRequest) (*CommandHandle, error)
	// TailCommand tails output of a command. TailCommand may be called at any
	// point before, during, or after a command executes.
	//
	// The returned stream will always contain the full output from the
	// beginning. The returned stream will be closed once the compilation is
	// finished and all data has been sent.
	TailCommand(*CommandHandle, Runner_TailCommandServer) error
	// StartCommand starts execution of a command, returning once it completes.
	StartCommand(context.Context, *CommandHandle) (*CommandStatus, error)
	// DeleteCommand removes a command. If the command is currently running, it
	// will be aborted. DeleteCommand must be called for every command once the
	// output is no longer needed.
	DeleteCommand(context.Context, *CommandHandle) (*Empty, error)
	// contains filtered or unexported methods
}

RunnerServer is the server API for Runner service. All implementations must embed UnimplementedRunnerServer for forward compatibility

type Runner_TailCommandClient

type Runner_TailCommandClient interface {
	Recv() (*TailCommandData, error)
	grpc.ClientStream
}

type Runner_TailCommandServer

type Runner_TailCommandServer interface {
	Send(*TailCommandData) error
	grpc.ServerStream
}

type Stream

type Stream int32
const (
	Stream_STREAM_UNKNOWN Stream = 0
	Stream_STREAM_STDOUT  Stream = 1
	Stream_STREAM_STDERR  Stream = 2
)

func (Stream) Descriptor

func (Stream) Descriptor() protoreflect.EnumDescriptor

func (Stream) Enum

func (x Stream) Enum() *Stream

func (Stream) EnumDescriptor deprecated

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

Deprecated: Use Stream.Descriptor instead.

func (Stream) Number

func (x Stream) Number() protoreflect.EnumNumber

func (Stream) String

func (x Stream) String() string

func (Stream) Type

func (Stream) Type() protoreflect.EnumType

type TailCommandData

type TailCommandData struct {

	// A fragment of data from tailed logs.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// The stream this data is from.
	Stream Stream `protobuf:"varint,2,opt,name=stream,proto3,enum=viceroy.v1.Stream" json:"stream,omitempty"`
	// contains filtered or unexported fields
}

func (*TailCommandData) Descriptor deprecated

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

Deprecated: Use TailCommandData.ProtoReflect.Descriptor instead.

func (*TailCommandData) GetData

func (x *TailCommandData) GetData() []byte

func (*TailCommandData) GetStream

func (x *TailCommandData) GetStream() Stream

func (*TailCommandData) ProtoMessage

func (*TailCommandData) ProtoMessage()

func (*TailCommandData) ProtoReflect

func (x *TailCommandData) ProtoReflect() protoreflect.Message

func (*TailCommandData) Reset

func (x *TailCommandData) Reset()

func (*TailCommandData) String

func (x *TailCommandData) String() string

type UnimplementedRunnerServer

type UnimplementedRunnerServer struct {
}

UnimplementedRunnerServer must be embedded to have forward compatible implementations.

func (UnimplementedRunnerServer) CreateCommand

func (UnimplementedRunnerServer) DeleteCommand

func (UnimplementedRunnerServer) StartCommand

func (UnimplementedRunnerServer) TailCommand

type UnsafeRunnerServer

type UnsafeRunnerServer interface {
	// contains filtered or unexported methods
}

UnsafeRunnerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RunnerServer will result in compilation errors.

Jump to

Keyboard shortcuts

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