api

package
v0.0.0-...-d9cb129 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_job_service_proto protoreflect.FileDescriptor
View Source
var Jobs_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Jobs",
	HandlerType: (*JobsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Start",
			Handler:    _Jobs_Start_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _Jobs_Stop_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _Jobs_Status_Handler,
		},
		{
			MethodName: "List",
			Handler:    _Jobs_List_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Monitor",
			Handler:       _Jobs_Monitor_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "job_service.proto",
}

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

Functions

func RegisterJobsServer

func RegisterJobsServer(s grpc.ServiceRegistrar, srv JobsServer)

Types

type ApiServer

type ApiServer struct {
	UnimplementedJobsServer
	Jobs map[string]command.JobConfig
}

func (*ApiServer) AuthorizeJob

func (server *ApiServer) AuthorizeJob(ctx context.Context, jobId string) bool

func (*ApiServer) List

func (server *ApiServer) List(ctx context.Context, _ *Empty) (*ListJobsResponse, error)

func (*ApiServer) Monitor

func (server *ApiServer) Monitor(input *MonitorJobInput, stream Jobs_MonitorServer) error

func (*ApiServer) Start

func (server *ApiServer) Start(ctx context.Context, input *StartJobInput) (*StartJobResponse, error)

func (*ApiServer) Status

func (server *ApiServer) Status(ctx context.Context, input *StatusInput) (*StatusResponse, error)

func (*ApiServer) Stop

func (server *ApiServer) Stop(ctx context.Context, input *StopJobInput) (*StopJobResponse, error)

type Empty

type Empty struct {
	// contains filtered or unexported 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 JobInfo

type JobInfo struct {
	TaskId   string `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	Status   string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // Can be RUNNING, STOPPED, or KILLED
	ExitCode int32  `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// contains filtered or unexported fields
}

func (*JobInfo) Descriptor deprecated

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

Deprecated: Use JobInfo.ProtoReflect.Descriptor instead.

func (*JobInfo) GetExitCode

func (x *JobInfo) GetExitCode() int32

func (*JobInfo) GetStatus

func (x *JobInfo) GetStatus() string

func (*JobInfo) GetTaskId

func (x *JobInfo) GetTaskId() string

func (*JobInfo) ProtoMessage

func (*JobInfo) ProtoMessage()

func (*JobInfo) ProtoReflect

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

func (*JobInfo) Reset

func (x *JobInfo) Reset()

func (*JobInfo) String

func (x *JobInfo) String() string

type JobsClient

type JobsClient interface {
	Start(ctx context.Context, in *StartJobInput, opts ...grpc.CallOption) (*StartJobResponse, error)
	Stop(ctx context.Context, in *StopJobInput, opts ...grpc.CallOption) (*StopJobResponse, error)
	Status(ctx context.Context, in *StatusInput, opts ...grpc.CallOption) (*StatusResponse, error)
	Monitor(ctx context.Context, in *MonitorJobInput, opts ...grpc.CallOption) (Jobs_MonitorClient, error)
	List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListJobsResponse, error)
}

JobsClient is the client API for Jobs 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 NewJobsClient

func NewJobsClient(cc grpc.ClientConnInterface) JobsClient

type JobsServer

type JobsServer interface {
	Start(context.Context, *StartJobInput) (*StartJobResponse, error)
	Stop(context.Context, *StopJobInput) (*StopJobResponse, error)
	Status(context.Context, *StatusInput) (*StatusResponse, error)
	Monitor(*MonitorJobInput, Jobs_MonitorServer) error
	List(context.Context, *Empty) (*ListJobsResponse, error)
	// contains filtered or unexported methods
}

JobsServer is the server API for Jobs service. All implementations must embed UnimplementedJobsServer for forward compatibility

type Jobs_MonitorClient

type Jobs_MonitorClient interface {
	Recv() (*MonitorJobResponse, error)
	grpc.ClientStream
}

type Jobs_MonitorServer

type Jobs_MonitorServer interface {
	Send(*MonitorJobResponse) error
	grpc.ServerStream
}

type ListJobsResponse

type ListJobsResponse struct {
	JobInfo []*JobInfo `protobuf:"bytes,1,rep,name=job_info,json=jobInfo,proto3" json:"job_info,omitempty"`
	// contains filtered or unexported fields
}

func (*ListJobsResponse) Descriptor deprecated

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

Deprecated: Use ListJobsResponse.ProtoReflect.Descriptor instead.

func (*ListJobsResponse) GetJobInfo

func (x *ListJobsResponse) GetJobInfo() []*JobInfo

func (*ListJobsResponse) ProtoMessage

func (*ListJobsResponse) ProtoMessage()

func (*ListJobsResponse) ProtoReflect

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

func (*ListJobsResponse) Reset

func (x *ListJobsResponse) Reset()

func (*ListJobsResponse) String

func (x *ListJobsResponse) String() string

type MonitorJobInput

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

func (*MonitorJobInput) Descriptor deprecated

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

Deprecated: Use MonitorJobInput.ProtoReflect.Descriptor instead.

func (*MonitorJobInput) GetJobId

func (x *MonitorJobInput) GetJobId() string

func (*MonitorJobInput) ProtoMessage

func (*MonitorJobInput) ProtoMessage()

func (*MonitorJobInput) ProtoReflect

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

func (*MonitorJobInput) Reset

func (x *MonitorJobInput) Reset()

func (*MonitorJobInput) String

func (x *MonitorJobInput) String() string

type MonitorJobResponse

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

func (*MonitorJobResponse) Descriptor deprecated

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

Deprecated: Use MonitorJobResponse.ProtoReflect.Descriptor instead.

func (*MonitorJobResponse) GetChunk

func (x *MonitorJobResponse) GetChunk() string

func (*MonitorJobResponse) ProtoMessage

func (*MonitorJobResponse) ProtoMessage()

func (*MonitorJobResponse) ProtoReflect

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

func (*MonitorJobResponse) Reset

func (x *MonitorJobResponse) Reset()

func (*MonitorJobResponse) String

func (x *MonitorJobResponse) String() string

type StartJobInput

type StartJobInput 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"`
	Cpu     int32    `protobuf:"varint,3,opt,name=cpu,proto3" json:"cpu,omitempty"`
	Memory  int32    `protobuf:"varint,4,opt,name=memory,proto3" json:"memory,omitempty"`
	Blkio   int32    `protobuf:"varint,5,opt,name=blkio,proto3" json:"blkio,omitempty"`
	// contains filtered or unexported fields
}

func (*StartJobInput) Descriptor deprecated

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

Deprecated: Use StartJobInput.ProtoReflect.Descriptor instead.

func (*StartJobInput) GetArgs

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

func (*StartJobInput) GetBlkio

func (x *StartJobInput) GetBlkio() int32

func (*StartJobInput) GetCommand

func (x *StartJobInput) GetCommand() string

func (*StartJobInput) GetCpu

func (x *StartJobInput) GetCpu() int32

func (*StartJobInput) GetMemory

func (x *StartJobInput) GetMemory() int32

func (*StartJobInput) ProtoMessage

func (*StartJobInput) ProtoMessage()

func (*StartJobInput) ProtoReflect

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

func (*StartJobInput) Reset

func (x *StartJobInput) Reset()

func (*StartJobInput) String

func (x *StartJobInput) String() string

type StartJobResponse

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

func (*StartJobResponse) Descriptor deprecated

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

Deprecated: Use StartJobResponse.ProtoReflect.Descriptor instead.

func (*StartJobResponse) GetJobId

func (x *StartJobResponse) GetJobId() string

func (*StartJobResponse) ProtoMessage

func (*StartJobResponse) ProtoMessage()

func (*StartJobResponse) ProtoReflect

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

func (*StartJobResponse) Reset

func (x *StartJobResponse) Reset()

func (*StartJobResponse) String

func (x *StartJobResponse) String() string

type StatusInput

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

func (*StatusInput) Descriptor deprecated

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

Deprecated: Use StatusInput.ProtoReflect.Descriptor instead.

func (*StatusInput) GetJobId

func (x *StatusInput) GetJobId() string

func (*StatusInput) ProtoMessage

func (*StatusInput) ProtoMessage()

func (*StatusInput) ProtoReflect

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

func (*StatusInput) Reset

func (x *StatusInput) Reset()

func (*StatusInput) String

func (x *StatusInput) String() string

type StatusResponse

type StatusResponse struct {
	Status   string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	ExitCode int32  `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// contains filtered or unexported fields
}

func (*StatusResponse) Descriptor deprecated

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

Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.

func (*StatusResponse) GetExitCode

func (x *StatusResponse) GetExitCode() int32

func (*StatusResponse) GetStatus

func (x *StatusResponse) GetStatus() string

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) ProtoReflect

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

func (*StatusResponse) Reset

func (x *StatusResponse) Reset()

func (*StatusResponse) String

func (x *StatusResponse) String() string

type StopJobInput

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

func (*StopJobInput) Descriptor deprecated

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

Deprecated: Use StopJobInput.ProtoReflect.Descriptor instead.

func (*StopJobInput) GetJobId

func (x *StopJobInput) GetJobId() string

func (*StopJobInput) ProtoMessage

func (*StopJobInput) ProtoMessage()

func (*StopJobInput) ProtoReflect

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

func (*StopJobInput) Reset

func (x *StopJobInput) Reset()

func (*StopJobInput) String

func (x *StopJobInput) String() string

type StopJobResponse

type StopJobResponse struct {
	ExitCode int32 `protobuf:"varint,1,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"`
	// contains filtered or unexported fields
}

func (*StopJobResponse) Descriptor deprecated

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

Deprecated: Use StopJobResponse.ProtoReflect.Descriptor instead.

func (*StopJobResponse) GetExitCode

func (x *StopJobResponse) GetExitCode() int32

func (*StopJobResponse) ProtoMessage

func (*StopJobResponse) ProtoMessage()

func (*StopJobResponse) ProtoReflect

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

func (*StopJobResponse) Reset

func (x *StopJobResponse) Reset()

func (*StopJobResponse) String

func (x *StopJobResponse) String() string

type UnimplementedJobsServer

type UnimplementedJobsServer struct {
}

UnimplementedJobsServer must be embedded to have forward compatible implementations.

func (UnimplementedJobsServer) List

func (UnimplementedJobsServer) Monitor

func (UnimplementedJobsServer) Start

func (UnimplementedJobsServer) Status

func (UnimplementedJobsServer) Stop

type UnsafeJobsServer

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

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

Jump to

Keyboard shortcuts

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