kanx

package
v0.113.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProcessState_name = map[int32]string{
		0: "PROCESS_STATE_UNSPECIFIED",
		1: "PROCESS_STATE_RUNNING",
		2: "PROCESS_STATE_SUCCEEDED",
		3: "PROCESS_STATE_FAILED",
	}
	ProcessState_value = map[string]int32{
		"PROCESS_STATE_UNSPECIFIED": 0,
		"PROCESS_STATE_RUNNING":     1,
		"PROCESS_STATE_SUCCEEDED":   2,
		"PROCESS_STATE_FAILED":      3,
	}
)

Enum value maps for ProcessState.

View Source
var File_pkg_kanx_kanx_proto protoreflect.FileDescriptor
View Source
var ProcessService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "kanx.ProcessService",
	HandlerType: (*ProcessServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateProcesses",
			Handler:    _ProcessService_CreateProcesses_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListProcesses",
			Handler:       _ProcessService_ListProcesses_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Stdout",
			Handler:       _ProcessService_Stdout_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Stderr",
			Handler:       _ProcessService_Stderr_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "pkg/kanx/kanx.proto",
}

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

Functions

func RegisterProcessServiceServer

func RegisterProcessServiceServer(s grpc.ServiceRegistrar, srv ProcessServiceServer)

func Stderr

func Stderr(ctx context.Context, addr string, pid int64, out io.Writer) error

func Stdout

func Stdout(ctx context.Context, addr string, pid int64, out io.Writer) error

Types

type CreateProcessRequest

type CreateProcessRequest struct {
	Name string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateProcessRequest) Descriptor deprecated

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

Deprecated: Use CreateProcessRequest.ProtoReflect.Descriptor instead.

func (*CreateProcessRequest) GetArgs

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

func (*CreateProcessRequest) GetName

func (x *CreateProcessRequest) GetName() string

func (*CreateProcessRequest) ProtoMessage

func (*CreateProcessRequest) ProtoMessage()

func (*CreateProcessRequest) ProtoReflect

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

func (*CreateProcessRequest) Reset

func (x *CreateProcessRequest) Reset()

func (*CreateProcessRequest) String

func (x *CreateProcessRequest) String() string

type ListProcessesRequest

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

func (*ListProcessesRequest) Descriptor deprecated

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

Deprecated: Use ListProcessesRequest.ProtoReflect.Descriptor instead.

func (*ListProcessesRequest) ProtoMessage

func (*ListProcessesRequest) ProtoMessage()

func (*ListProcessesRequest) ProtoReflect

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

func (*ListProcessesRequest) Reset

func (x *ListProcessesRequest) Reset()

func (*ListProcessesRequest) String

func (x *ListProcessesRequest) String() string

type Output

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

func (*Output) Descriptor deprecated

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

Deprecated: Use Output.ProtoReflect.Descriptor instead.

func (*Output) GetOutput

func (x *Output) GetOutput() string

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) ProtoReflect

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

func (*Output) Reset

func (x *Output) Reset()

func (*Output) String

func (x *Output) String() string

type Process

type Process struct {
	Pid      int64        `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	State    ProcessState `protobuf:"varint,2,opt,name=state,proto3,enum=kanx.ProcessState" json:"state,omitempty"`
	ExitCode int64        `protobuf:"varint,3,opt,name=exitCode,proto3" json:"exitCode,omitempty"`
	ExitErr  string       `protobuf:"bytes,4,opt,name=exitErr,proto3" json:"exitErr,omitempty"`
	// contains filtered or unexported fields
}

func CreateProcess

func CreateProcess(ctx context.Context, addr string, name string, args []string) (*Process, error)

func ListProcesses

func ListProcesses(ctx context.Context, addr string) ([]*Process, error)

func (*Process) Descriptor deprecated

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

Deprecated: Use Process.ProtoReflect.Descriptor instead.

func (*Process) GetExitCode

func (x *Process) GetExitCode() int64

func (*Process) GetExitErr

func (x *Process) GetExitErr() string

func (*Process) GetPid

func (x *Process) GetPid() int64

func (*Process) GetState

func (x *Process) GetState() ProcessState

func (*Process) ProtoMessage

func (*Process) ProtoMessage()

func (*Process) ProtoReflect

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

func (*Process) Reset

func (x *Process) Reset()

func (*Process) String

func (x *Process) String() string

type ProcessOutputRequest

type ProcessOutputRequest struct {
	Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*ProcessOutputRequest) Descriptor deprecated

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

Deprecated: Use ProcessOutputRequest.ProtoReflect.Descriptor instead.

func (*ProcessOutputRequest) GetPid

func (x *ProcessOutputRequest) GetPid() int64

func (*ProcessOutputRequest) ProtoMessage

func (*ProcessOutputRequest) ProtoMessage()

func (*ProcessOutputRequest) ProtoReflect

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

func (*ProcessOutputRequest) Reset

func (x *ProcessOutputRequest) Reset()

func (*ProcessOutputRequest) String

func (x *ProcessOutputRequest) String() string

type ProcessServiceClient

ProcessServiceClient is the client API for ProcessService 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 ProcessServiceServer

type ProcessServiceServer interface {
	CreateProcesses(context.Context, *CreateProcessRequest) (*Process, error)
	ListProcesses(*ListProcessesRequest, ProcessService_ListProcessesServer) error
	Stdout(*ProcessOutputRequest, ProcessService_StdoutServer) error
	Stderr(*ProcessOutputRequest, ProcessService_StderrServer) error
	// contains filtered or unexported methods
}

ProcessServiceServer is the server API for ProcessService service. All implementations must embed UnimplementedProcessServiceServer for forward compatibility

type ProcessService_ListProcessesClient

type ProcessService_ListProcessesClient interface {
	Recv() (*Process, error)
	grpc.ClientStream
}

type ProcessService_ListProcessesServer

type ProcessService_ListProcessesServer interface {
	Send(*Process) error
	grpc.ServerStream
}

type ProcessService_StderrClient

type ProcessService_StderrClient interface {
	Recv() (*Output, error)
	grpc.ClientStream
}

type ProcessService_StderrServer

type ProcessService_StderrServer interface {
	Send(*Output) error
	grpc.ServerStream
}

type ProcessService_StdoutClient

type ProcessService_StdoutClient interface {
	Recv() (*Output, error)
	grpc.ClientStream
}

type ProcessService_StdoutServer

type ProcessService_StdoutServer interface {
	Send(*Output) error
	grpc.ServerStream
}

type ProcessState

type ProcessState int32
const (
	ProcessState_PROCESS_STATE_UNSPECIFIED ProcessState = 0
	ProcessState_PROCESS_STATE_RUNNING     ProcessState = 1
	ProcessState_PROCESS_STATE_SUCCEEDED   ProcessState = 2
	ProcessState_PROCESS_STATE_FAILED      ProcessState = 3
)

func (ProcessState) Descriptor

func (ProcessState) Enum

func (x ProcessState) Enum() *ProcessState

func (ProcessState) EnumDescriptor deprecated

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

Deprecated: Use ProcessState.Descriptor instead.

func (ProcessState) Number

func (ProcessState) String

func (x ProcessState) String() string

func (ProcessState) Type

type Server

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

func NewServer

func NewServer() *Server

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, addr string) error

type UnimplementedProcessServiceServer

type UnimplementedProcessServiceServer struct {
}

UnimplementedProcessServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedProcessServiceServer) CreateProcesses

func (UnimplementedProcessServiceServer) ListProcesses

func (UnimplementedProcessServiceServer) Stderr

func (UnimplementedProcessServiceServer) Stdout

type UnsafeProcessServiceServer

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

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

Jump to

Keyboard shortcuts

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