runnerv1

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExecuteStop_name = map[int32]string{
		0: "EXECUTE_STOP_UNSPECIFIED",
		1: "EXECUTE_STOP_INTERRUPT",
		2: "EXECUTE_STOP_KILL",
	}
	ExecuteStop_value = map[string]int32{
		"EXECUTE_STOP_UNSPECIFIED": 0,
		"EXECUTE_STOP_INTERRUPT":   1,
		"EXECUTE_STOP_KILL":        2,
	}
)

Enum value maps for ExecuteStop.

View Source
var File_runme_runner_v1_runner_proto protoreflect.FileDescriptor
View Source
var RunnerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "runme.runner.v1.RunnerService",
	HandlerType: (*RunnerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateSession",
			Handler:    _RunnerService_CreateSession_Handler,
		},
		{
			MethodName: "GetSession",
			Handler:    _RunnerService_GetSession_Handler,
		},
		{
			MethodName: "ListSessions",
			Handler:    _RunnerService_ListSessions_Handler,
		},
		{
			MethodName: "DeleteSession",
			Handler:    _RunnerService_DeleteSession_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Execute",
			Handler:       _RunnerService_Execute_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "runme/runner/v1/runner.proto",
}

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

Functions

func RegisterRunnerServiceServer

func RegisterRunnerServiceServer(s grpc.ServiceRegistrar, srv RunnerServiceServer)

Types

type CreateSessionRequest

type CreateSessionRequest struct {

	// metadata is a map of client specific metadata.
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// envs field provides an initial set of environment variables
	// for a newly created session.
	Envs []string `protobuf:"bytes,2,rep,name=envs,proto3" json:"envs,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateSessionRequest) Descriptor deprecated

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

Deprecated: Use CreateSessionRequest.ProtoReflect.Descriptor instead.

func (*CreateSessionRequest) GetEnvs

func (x *CreateSessionRequest) GetEnvs() []string

func (*CreateSessionRequest) GetMetadata

func (x *CreateSessionRequest) GetMetadata() map[string]string

func (*CreateSessionRequest) ProtoMessage

func (*CreateSessionRequest) ProtoMessage()

func (*CreateSessionRequest) ProtoReflect

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

func (*CreateSessionRequest) Reset

func (x *CreateSessionRequest) Reset()

func (*CreateSessionRequest) String

func (x *CreateSessionRequest) String() string

type CreateSessionResponse

type CreateSessionResponse struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateSessionResponse) Descriptor deprecated

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

Deprecated: Use CreateSessionResponse.ProtoReflect.Descriptor instead.

func (*CreateSessionResponse) GetSession

func (x *CreateSessionResponse) GetSession() *Session

func (*CreateSessionResponse) ProtoMessage

func (*CreateSessionResponse) ProtoMessage()

func (*CreateSessionResponse) ProtoReflect

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

func (*CreateSessionResponse) Reset

func (x *CreateSessionResponse) Reset()

func (*CreateSessionResponse) String

func (x *CreateSessionResponse) String() string

type DeleteSessionRequest

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

func (*DeleteSessionRequest) Descriptor deprecated

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

Deprecated: Use DeleteSessionRequest.ProtoReflect.Descriptor instead.

func (*DeleteSessionRequest) GetId

func (x *DeleteSessionRequest) GetId() string

func (*DeleteSessionRequest) ProtoMessage

func (*DeleteSessionRequest) ProtoMessage()

func (*DeleteSessionRequest) ProtoReflect

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

func (*DeleteSessionRequest) Reset

func (x *DeleteSessionRequest) Reset()

func (*DeleteSessionRequest) String

func (x *DeleteSessionRequest) String() string

type DeleteSessionResponse

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

func (*DeleteSessionResponse) Descriptor deprecated

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

Deprecated: Use DeleteSessionResponse.ProtoReflect.Descriptor instead.

func (*DeleteSessionResponse) ProtoMessage

func (*DeleteSessionResponse) ProtoMessage()

func (*DeleteSessionResponse) ProtoReflect

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

func (*DeleteSessionResponse) Reset

func (x *DeleteSessionResponse) Reset()

func (*DeleteSessionResponse) String

func (x *DeleteSessionResponse) String() string

type ExecuteRequest

type ExecuteRequest struct {

	// program_name is a name of the program to execute.
	// If it's not a path (relative or absolute), the runner
	// will try to resolve the name.
	// For example: "sh", "/bin/bash".
	ProgramName string `protobuf:"bytes,1,opt,name=program_name,json=programName,proto3" json:"program_name,omitempty"`
	// arguments is a list of arguments passed to the program.
	Arguments []string `protobuf:"bytes,2,rep,name=arguments,proto3" json:"arguments,omitempty"`
	// directory to execute the program in.
	Directory string `protobuf:"bytes,3,opt,name=directory,proto3" json:"directory,omitempty"`
	// envs is a list of additional environment variables
	// that will be injected to the executed program.
	Envs []string `protobuf:"bytes,4,rep,name=envs,proto3" json:"envs,omitempty"`
	// commands are commands to be executed by the program.
	// The commands are joined and executed as a script.
	// For example: "echo 'Hello, World'", "ls -l /etc".
	// This is mutually exclusive with the script field.
	Commands []string `protobuf:"bytes,5,rep,name=commands,proto3" json:"commands,omitempty"`
	// script is code to be executed by the program.
	// Individual lines are joined with the new line character.
	// This is mutually exclusive with the commands field.
	Script string `protobuf:"bytes,6,opt,name=script,proto3" json:"script,omitempty"`
	// tty when true allocates a pseudo-TTY.
	Tty bool `protobuf:"varint,7,opt,name=tty,proto3" json:"tty,omitempty"`
	// input_data is a byte array that will be send as input
	// to the program.
	InputData []byte `protobuf:"bytes,8,opt,name=input_data,json=inputData,proto3" json:"input_data,omitempty"`
	// stop requests the running process to be stopped.
	// It is allowed only in the consecutive calls.
	Stop ExecuteStop `protobuf:"varint,9,opt,name=stop,proto3,enum=runme.runner.v1.ExecuteStop" json:"stop,omitempty"`
	// session_id indicates in which Session the program should execute.
	// Executing in a Session might provide additional context like
	// environment variables.
	SessionId string `protobuf:"bytes,20,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecuteRequest) Descriptor deprecated

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

Deprecated: Use ExecuteRequest.ProtoReflect.Descriptor instead.

func (*ExecuteRequest) GetArguments

func (x *ExecuteRequest) GetArguments() []string

func (*ExecuteRequest) GetCommands

func (x *ExecuteRequest) GetCommands() []string

func (*ExecuteRequest) GetDirectory

func (x *ExecuteRequest) GetDirectory() string

func (*ExecuteRequest) GetEnvs

func (x *ExecuteRequest) GetEnvs() []string

func (*ExecuteRequest) GetInputData

func (x *ExecuteRequest) GetInputData() []byte

func (*ExecuteRequest) GetProgramName

func (x *ExecuteRequest) GetProgramName() string

func (*ExecuteRequest) GetScript

func (x *ExecuteRequest) GetScript() string

func (*ExecuteRequest) GetSessionId

func (x *ExecuteRequest) GetSessionId() string

func (*ExecuteRequest) GetStop

func (x *ExecuteRequest) GetStop() ExecuteStop

func (*ExecuteRequest) GetTty

func (x *ExecuteRequest) GetTty() bool

func (*ExecuteRequest) ProtoMessage

func (*ExecuteRequest) ProtoMessage()

func (*ExecuteRequest) ProtoReflect

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

func (*ExecuteRequest) Reset

func (x *ExecuteRequest) Reset()

func (*ExecuteRequest) String

func (x *ExecuteRequest) String() string

type ExecuteResponse

type ExecuteResponse struct {

	// exit_code is sent only in the final message.
	ExitCode *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// stdout_data contains bytes from stdout since the last response.
	StdoutData []byte `protobuf:"bytes,2,opt,name=stdout_data,json=stdoutData,proto3" json:"stdout_data,omitempty"`
	// stderr_data contains bytes from stderr since the last response.
	StderrData []byte `protobuf:"bytes,3,opt,name=stderr_data,json=stderrData,proto3" json:"stderr_data,omitempty"`
	// contains filtered or unexported fields
}

func (*ExecuteResponse) Descriptor deprecated

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

Deprecated: Use ExecuteResponse.ProtoReflect.Descriptor instead.

func (*ExecuteResponse) GetExitCode

func (x *ExecuteResponse) GetExitCode() *wrapperspb.UInt32Value

func (*ExecuteResponse) GetStderrData

func (x *ExecuteResponse) GetStderrData() []byte

func (*ExecuteResponse) GetStdoutData

func (x *ExecuteResponse) GetStdoutData() []byte

func (*ExecuteResponse) ProtoMessage

func (*ExecuteResponse) ProtoMessage()

func (*ExecuteResponse) ProtoReflect

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

func (*ExecuteResponse) Reset

func (x *ExecuteResponse) Reset()

func (*ExecuteResponse) String

func (x *ExecuteResponse) String() string

type ExecuteStop

type ExecuteStop int32
const (
	ExecuteStop_EXECUTE_STOP_UNSPECIFIED ExecuteStop = 0
	ExecuteStop_EXECUTE_STOP_INTERRUPT   ExecuteStop = 1
	ExecuteStop_EXECUTE_STOP_KILL        ExecuteStop = 2
)

func (ExecuteStop) Descriptor

func (ExecuteStop) Enum

func (x ExecuteStop) Enum() *ExecuteStop

func (ExecuteStop) EnumDescriptor deprecated

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

Deprecated: Use ExecuteStop.Descriptor instead.

func (ExecuteStop) Number

func (x ExecuteStop) Number() protoreflect.EnumNumber

func (ExecuteStop) String

func (x ExecuteStop) String() string

func (ExecuteStop) Type

type GetSessionRequest

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

func (*GetSessionRequest) Descriptor deprecated

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

Deprecated: Use GetSessionRequest.ProtoReflect.Descriptor instead.

func (*GetSessionRequest) GetId

func (x *GetSessionRequest) GetId() string

func (*GetSessionRequest) ProtoMessage

func (*GetSessionRequest) ProtoMessage()

func (*GetSessionRequest) ProtoReflect

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

func (*GetSessionRequest) Reset

func (x *GetSessionRequest) Reset()

func (*GetSessionRequest) String

func (x *GetSessionRequest) String() string

type GetSessionResponse

type GetSessionResponse struct {
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSessionResponse) Descriptor deprecated

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

Deprecated: Use GetSessionResponse.ProtoReflect.Descriptor instead.

func (*GetSessionResponse) GetSession

func (x *GetSessionResponse) GetSession() *Session

func (*GetSessionResponse) ProtoMessage

func (*GetSessionResponse) ProtoMessage()

func (*GetSessionResponse) ProtoReflect

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

func (*GetSessionResponse) Reset

func (x *GetSessionResponse) Reset()

func (*GetSessionResponse) String

func (x *GetSessionResponse) String() string

type ListSessionsRequest

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

func (*ListSessionsRequest) Descriptor deprecated

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

Deprecated: Use ListSessionsRequest.ProtoReflect.Descriptor instead.

func (*ListSessionsRequest) ProtoMessage

func (*ListSessionsRequest) ProtoMessage()

func (*ListSessionsRequest) ProtoReflect

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

func (*ListSessionsRequest) Reset

func (x *ListSessionsRequest) Reset()

func (*ListSessionsRequest) String

func (x *ListSessionsRequest) String() string

type ListSessionsResponse

type ListSessionsResponse struct {
	Sessions []*Session `protobuf:"bytes,1,rep,name=sessions,proto3" json:"sessions,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSessionsResponse) Descriptor deprecated

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

Deprecated: Use ListSessionsResponse.ProtoReflect.Descriptor instead.

func (*ListSessionsResponse) GetSessions

func (x *ListSessionsResponse) GetSessions() []*Session

func (*ListSessionsResponse) ProtoMessage

func (*ListSessionsResponse) ProtoMessage()

func (*ListSessionsResponse) ProtoReflect

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

func (*ListSessionsResponse) Reset

func (x *ListSessionsResponse) Reset()

func (*ListSessionsResponse) String

func (x *ListSessionsResponse) String() string

type RunnerServiceClient

type RunnerServiceClient interface {
	CreateSession(ctx context.Context, in *CreateSessionRequest, opts ...grpc.CallOption) (*CreateSessionResponse, error)
	GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error)
	ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error)
	DeleteSession(ctx context.Context, in *DeleteSessionRequest, opts ...grpc.CallOption) (*DeleteSessionResponse, error)
	// Execute executes a program. Examine "ExecuteRequest" to explore
	// configuration options.
	//
	// It's a bidirectional stream RPC method. It expects the first
	// "ExecuteRequest" to contain details of a program to execute.
	// Subsequent "ExecuteRequest" should only contain "input_data" as
	// other fields will be ignored.
	Execute(ctx context.Context, opts ...grpc.CallOption) (RunnerService_ExecuteClient, error)
}

RunnerServiceClient is the client API for RunnerService 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.

type RunnerServiceServer

type RunnerServiceServer interface {
	CreateSession(context.Context, *CreateSessionRequest) (*CreateSessionResponse, error)
	GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error)
	ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error)
	DeleteSession(context.Context, *DeleteSessionRequest) (*DeleteSessionResponse, error)
	// Execute executes a program. Examine "ExecuteRequest" to explore
	// configuration options.
	//
	// It's a bidirectional stream RPC method. It expects the first
	// "ExecuteRequest" to contain details of a program to execute.
	// Subsequent "ExecuteRequest" should only contain "input_data" as
	// other fields will be ignored.
	Execute(RunnerService_ExecuteServer) error
	// contains filtered or unexported methods
}

RunnerServiceServer is the server API for RunnerService service. All implementations must embed UnimplementedRunnerServiceServer for forward compatibility

type RunnerService_ExecuteClient

type RunnerService_ExecuteClient interface {
	Send(*ExecuteRequest) error
	Recv() (*ExecuteResponse, error)
	grpc.ClientStream
}

type RunnerService_ExecuteServer

type RunnerService_ExecuteServer interface {
	Send(*ExecuteResponse) error
	Recv() (*ExecuteRequest, error)
	grpc.ServerStream
}

type Session

type Session struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// envs keeps track of session environment variables.
	// They can be modified by executing programs which
	// alter them through "export" and "unset" commands.
	Envs []string `protobuf:"bytes,2,rep,name=envs,proto3" json:"envs,omitempty"`
	// metadata is a map of client specific metadata.
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetEnvs

func (x *Session) GetEnvs() []string

func (*Session) GetId

func (x *Session) GetId() string

func (*Session) GetMetadata

func (x *Session) GetMetadata() map[string]string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type UnimplementedRunnerServiceServer

type UnimplementedRunnerServiceServer struct {
}

UnimplementedRunnerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRunnerServiceServer) CreateSession

func (UnimplementedRunnerServiceServer) DeleteSession

func (UnimplementedRunnerServiceServer) Execute

func (UnimplementedRunnerServiceServer) GetSession

func (UnimplementedRunnerServiceServer) ListSessions

type UnsafeRunnerServiceServer

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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