vmproto

package
v0.0.0-...-da06211 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

README

Proto generation

To generate Go source files from proto, we use docker.

The following command will generate Go source code files in docker and save the output to the current directory. Run this once every time you make any changes or additions to the .proto files. Add the generated .go files, and any changes to the .proto files, to your branch before creating a PR.

DOCKER_BUILDKIT=1 docker build -o .. -f Dockerfile.gen-proto ..

Documentation

Index

Constants

This section is empty.

Variables

View Source
var API_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vmapi.API",
	HandlerType: (*APIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ExecCommand",
			Handler:    _API_ExecCommand_Handler,
		},
		{
			MethodName: "WriteFile",
			Handler:    _API_WriteFile_Handler,
		},
		{
			MethodName: "ReadFile",
			Handler:    _API_ReadFile_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ExecCommandStream",
			Handler:       _API_ExecCommandStream_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "ExecCommandReturnStream",
			Handler:       _API_ExecCommandReturnStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "vmapi.proto",
}

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

View Source
var File_vmapi_proto protoreflect.FileDescriptor

Functions

func RegisterAPIServer

func RegisterAPIServer(s grpc.ServiceRegistrar, srv APIServer)

Types

type APIClient

type APIClient interface {
	ExecCommandStream(ctx context.Context, opts ...grpc.CallOption) (API_ExecCommandStreamClient, error)
	ExecCommandReturnStream(ctx context.Context, in *ExecCommandRequest, opts ...grpc.CallOption) (API_ExecCommandReturnStreamClient, error)
	ExecCommand(ctx context.Context, in *ExecCommandRequest, opts ...grpc.CallOption) (*ExecCommandResponse, error)
	WriteFile(ctx context.Context, in *WriteFileRequest, opts ...grpc.CallOption) (*WriteFileResponse, error)
	ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error)
}

APIClient is the client API for API 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 NewAPIClient

func NewAPIClient(cc grpc.ClientConnInterface) APIClient

type APIServer

type APIServer interface {
	ExecCommandStream(API_ExecCommandStreamServer) error
	ExecCommandReturnStream(*ExecCommandRequest, API_ExecCommandReturnStreamServer) error
	ExecCommand(context.Context, *ExecCommandRequest) (*ExecCommandResponse, error)
	WriteFile(context.Context, *WriteFileRequest) (*WriteFileResponse, error)
	ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error)
	// contains filtered or unexported methods
}

APIServer is the server API for API service. All implementations must embed UnimplementedAPIServer for forward compatibility

type API_ExecCommandReturnStreamClient

type API_ExecCommandReturnStreamClient interface {
	Recv() (*ExecCommandReturnStreamResponse, error)
	grpc.ClientStream
}

type API_ExecCommandReturnStreamServer

type API_ExecCommandReturnStreamServer interface {
	Send(*ExecCommandReturnStreamResponse) error
	grpc.ServerStream
}

type API_ExecCommandStreamClient

type API_ExecCommandStreamClient interface {
	Send(*ExecCommandStreamRequest) error
	Recv() (*ExecCommandStreamResponse, error)
	grpc.ClientStream
}

type API_ExecCommandStreamServer

type API_ExecCommandStreamServer interface {
	Send(*ExecCommandStreamResponse) error
	Recv() (*ExecCommandStreamRequest, error)
	grpc.ServerStream
}

type ExecCommandRequest

type ExecCommandRequest struct {
	Command string   `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	Args    []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	Tty     bool     `protobuf:"varint,3,opt,name=tty,proto3" json:"tty,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecCommandRequest) Descriptor deprecated

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

Deprecated: Use ExecCommandRequest.ProtoReflect.Descriptor instead.

func (*ExecCommandRequest) GetArgs

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

func (*ExecCommandRequest) GetCommand

func (x *ExecCommandRequest) GetCommand() string

func (*ExecCommandRequest) GetTty

func (x *ExecCommandRequest) GetTty() bool

func (*ExecCommandRequest) ProtoMessage

func (*ExecCommandRequest) ProtoMessage()

func (*ExecCommandRequest) ProtoReflect

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

func (*ExecCommandRequest) Reset

func (x *ExecCommandRequest) Reset()

func (*ExecCommandRequest) String

func (x *ExecCommandRequest) String() string

type ExecCommandResponse

type ExecCommandResponse struct {
	Output []byte `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecCommandResponse) Descriptor deprecated

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

Deprecated: Use ExecCommandResponse.ProtoReflect.Descriptor instead.

func (*ExecCommandResponse) GetOutput

func (x *ExecCommandResponse) GetOutput() []byte

func (*ExecCommandResponse) ProtoMessage

func (*ExecCommandResponse) ProtoMessage()

func (*ExecCommandResponse) ProtoReflect

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

func (*ExecCommandResponse) Reset

func (x *ExecCommandResponse) Reset()

func (*ExecCommandResponse) String

func (x *ExecCommandResponse) String() string

type ExecCommandReturnStreamResponse

type ExecCommandReturnStreamResponse struct {

	// Types that are assignable to Content:
	//
	//	*ExecCommandReturnStreamResponse_Output
	//	*ExecCommandReturnStreamResponse_Log
	Content isExecCommandReturnStreamResponse_Content `protobuf_oneof:"content"`
	// contains filtered or unexported fields
}

func (*ExecCommandReturnStreamResponse) Descriptor deprecated

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

Deprecated: Use ExecCommandReturnStreamResponse.ProtoReflect.Descriptor instead.

func (*ExecCommandReturnStreamResponse) GetContent

func (m *ExecCommandReturnStreamResponse) GetContent() isExecCommandReturnStreamResponse_Content

func (*ExecCommandReturnStreamResponse) GetLog

func (x *ExecCommandReturnStreamResponse) GetLog() *Log

func (*ExecCommandReturnStreamResponse) GetOutput

func (x *ExecCommandReturnStreamResponse) GetOutput() []byte

func (*ExecCommandReturnStreamResponse) ProtoMessage

func (*ExecCommandReturnStreamResponse) ProtoMessage()

func (*ExecCommandReturnStreamResponse) ProtoReflect

func (*ExecCommandReturnStreamResponse) Reset

func (*ExecCommandReturnStreamResponse) String

type ExecCommandReturnStreamResponse_Log

type ExecCommandReturnStreamResponse_Log struct {
	Log *Log `protobuf:"bytes,2,opt,name=log,proto3,oneof"`
}

type ExecCommandReturnStreamResponse_Output

type ExecCommandReturnStreamResponse_Output struct {
	Output []byte `protobuf:"bytes,1,opt,name=output,proto3,oneof"`
}

type ExecCommandStreamRequest

type ExecCommandStreamRequest struct {

	// Types that are assignable to Content:
	//
	//	*ExecCommandStreamRequest_Command
	//	*ExecCommandStreamRequest_Stdin
	//	*ExecCommandStreamRequest_Termsize
	Content isExecCommandStreamRequest_Content `protobuf_oneof:"content"`
	// contains filtered or unexported fields
}

func (*ExecCommandStreamRequest) Descriptor deprecated

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

Deprecated: Use ExecCommandStreamRequest.ProtoReflect.Descriptor instead.

func (*ExecCommandStreamRequest) GetCommand

func (*ExecCommandStreamRequest) GetContent

func (m *ExecCommandStreamRequest) GetContent() isExecCommandStreamRequest_Content

func (*ExecCommandStreamRequest) GetStdin

func (x *ExecCommandStreamRequest) GetStdin() []byte

func (*ExecCommandStreamRequest) GetTermsize

func (*ExecCommandStreamRequest) ProtoMessage

func (*ExecCommandStreamRequest) ProtoMessage()

func (*ExecCommandStreamRequest) ProtoReflect

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

func (*ExecCommandStreamRequest) Reset

func (x *ExecCommandStreamRequest) Reset()

func (*ExecCommandStreamRequest) String

func (x *ExecCommandStreamRequest) String() string

type ExecCommandStreamRequest_Command

type ExecCommandStreamRequest_Command struct {
	Command *ExecCommandRequest `protobuf:"bytes,1,opt,name=command,proto3,oneof"`
}

type ExecCommandStreamRequest_Stdin

type ExecCommandStreamRequest_Stdin struct {
	Stdin []byte `protobuf:"bytes,2,opt,name=stdin,proto3,oneof"`
}

type ExecCommandStreamRequest_Termsize

type ExecCommandStreamRequest_Termsize struct {
	Termsize *TerminalSizeRequest `protobuf:"bytes,3,opt,name=termsize,proto3,oneof"`
}

type ExecCommandStreamResponse

type ExecCommandStreamResponse struct {

	// Types that are assignable to Content:
	//
	//	*ExecCommandStreamResponse_Stdout
	//	*ExecCommandStreamResponse_Stderr
	//	*ExecCommandStreamResponse_Err
	Content isExecCommandStreamResponse_Content `protobuf_oneof:"content"`
	// contains filtered or unexported fields
}

func (*ExecCommandStreamResponse) Descriptor deprecated

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

Deprecated: Use ExecCommandStreamResponse.ProtoReflect.Descriptor instead.

func (*ExecCommandStreamResponse) GetContent

func (m *ExecCommandStreamResponse) GetContent() isExecCommandStreamResponse_Content

func (*ExecCommandStreamResponse) GetErr

func (x *ExecCommandStreamResponse) GetErr() string

func (*ExecCommandStreamResponse) GetStderr

func (x *ExecCommandStreamResponse) GetStderr() []byte

func (*ExecCommandStreamResponse) GetStdout

func (x *ExecCommandStreamResponse) GetStdout() []byte

func (*ExecCommandStreamResponse) ProtoMessage

func (*ExecCommandStreamResponse) ProtoMessage()

func (*ExecCommandStreamResponse) ProtoReflect

func (*ExecCommandStreamResponse) Reset

func (x *ExecCommandStreamResponse) Reset()

func (*ExecCommandStreamResponse) String

func (x *ExecCommandStreamResponse) String() string

type ExecCommandStreamResponse_Err

type ExecCommandStreamResponse_Err struct {
	Err string `protobuf:"bytes,3,opt,name=err,proto3,oneof"`
}

type ExecCommandStreamResponse_Stderr

type ExecCommandStreamResponse_Stderr struct {
	Stderr []byte `protobuf:"bytes,2,opt,name=stderr,proto3,oneof"`
}

type ExecCommandStreamResponse_Stdout

type ExecCommandStreamResponse_Stdout struct {
	Stdout []byte `protobuf:"bytes,1,opt,name=stdout,proto3,oneof"`
}

type Log

type Log struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Log) Descriptor deprecated

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

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetMessage

func (x *Log) GetMessage() string

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

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

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type ReadFileRequest

type ReadFileRequest struct {
	Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"`
	Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadFileRequest) Descriptor deprecated

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

Deprecated: Use ReadFileRequest.ProtoReflect.Descriptor instead.

func (*ReadFileRequest) GetFilename

func (x *ReadFileRequest) GetFilename() string

func (*ReadFileRequest) GetFilepath

func (x *ReadFileRequest) GetFilepath() string

func (*ReadFileRequest) ProtoMessage

func (*ReadFileRequest) ProtoMessage()

func (*ReadFileRequest) ProtoReflect

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

func (*ReadFileRequest) Reset

func (x *ReadFileRequest) Reset()

func (*ReadFileRequest) String

func (x *ReadFileRequest) String() string

type ReadFileResponse

type ReadFileResponse struct {
	Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadFileResponse) Descriptor deprecated

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

Deprecated: Use ReadFileResponse.ProtoReflect.Descriptor instead.

func (*ReadFileResponse) GetContent

func (x *ReadFileResponse) GetContent() []byte

func (*ReadFileResponse) ProtoMessage

func (*ReadFileResponse) ProtoMessage()

func (*ReadFileResponse) ProtoReflect

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

func (*ReadFileResponse) Reset

func (x *ReadFileResponse) Reset()

func (*ReadFileResponse) String

func (x *ReadFileResponse) String() string

type TerminalSizeRequest

type TerminalSizeRequest struct {
	Width  int32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
	Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

func (*TerminalSizeRequest) Descriptor deprecated

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

Deprecated: Use TerminalSizeRequest.ProtoReflect.Descriptor instead.

func (*TerminalSizeRequest) GetHeight

func (x *TerminalSizeRequest) GetHeight() int32

func (*TerminalSizeRequest) GetWidth

func (x *TerminalSizeRequest) GetWidth() int32

func (*TerminalSizeRequest) ProtoMessage

func (*TerminalSizeRequest) ProtoMessage()

func (*TerminalSizeRequest) ProtoReflect

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

func (*TerminalSizeRequest) Reset

func (x *TerminalSizeRequest) Reset()

func (*TerminalSizeRequest) String

func (x *TerminalSizeRequest) String() string

type UnimplementedAPIServer

type UnimplementedAPIServer struct {
}

UnimplementedAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedAPIServer) ExecCommand

func (UnimplementedAPIServer) ExecCommandReturnStream

func (UnimplementedAPIServer) ExecCommandStream

func (UnimplementedAPIServer) ReadFile

func (UnimplementedAPIServer) WriteFile

type UnsafeAPIServer

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

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

type WriteFileRequest

type WriteFileRequest struct {
	Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"`
	Filename string `protobuf:"bytes,2,opt,name=filename,proto3" json:"filename,omitempty"`
	Content  []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*WriteFileRequest) Descriptor deprecated

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

Deprecated: Use WriteFileRequest.ProtoReflect.Descriptor instead.

func (*WriteFileRequest) GetContent

func (x *WriteFileRequest) GetContent() []byte

func (*WriteFileRequest) GetFilename

func (x *WriteFileRequest) GetFilename() string

func (*WriteFileRequest) GetFilepath

func (x *WriteFileRequest) GetFilepath() string

func (*WriteFileRequest) ProtoMessage

func (*WriteFileRequest) ProtoMessage()

func (*WriteFileRequest) ProtoReflect

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

func (*WriteFileRequest) Reset

func (x *WriteFileRequest) Reset()

func (*WriteFileRequest) String

func (x *WriteFileRequest) String() string

type WriteFileResponse

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

func (*WriteFileResponse) Descriptor deprecated

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

Deprecated: Use WriteFileResponse.ProtoReflect.Descriptor instead.

func (*WriteFileResponse) ProtoMessage

func (*WriteFileResponse) ProtoMessage()

func (*WriteFileResponse) ProtoReflect

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

func (*WriteFileResponse) Reset

func (x *WriteFileResponse) Reset()

func (*WriteFileResponse) String

func (x *WriteFileResponse) String() string

Jump to

Keyboard shortcuts

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