Documentation ¶
Index ¶
- Variables
- func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
- type Container
- func (*Container) Descriptor() ([]byte, []int)deprecated
- func (x *Container) GetCommand() []string
- func (x *Container) GetEnv() map[string]string
- func (x *Container) GetId() string
- func (x *Container) GetImage() string
- func (x *Container) GetInputs() []*Volume
- func (x *Container) GetOutputs() []*Volume
- func (x *Container) GetWorkDir() string
- func (*Container) ProtoMessage()
- func (x *Container) ProtoReflect() protoreflect.Message
- func (x *Container) Reset()
- func (x *Container) String() string
- type Info
- func (*Info) Descriptor() ([]byte, []int)deprecated
- func (x *Info) GetCpuCores() int32
- func (x *Info) GetIdentifiedCpuCores() int32
- func (x *Info) GetIdentifiedRamGb() float64
- func (x *Info) GetRamGb() float64
- func (*Info) ProtoMessage()
- func (x *Info) ProtoReflect() protoreflect.Message
- func (x *Info) Reset()
- func (x *Info) String() string
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetCpuPercent() float64
- func (x *State) GetCpuTime() uint64
- func (x *State) GetEnd() *timestamp.Timestamp
- func (x *State) GetExitCode() int32
- func (x *State) GetExited() bool
- func (x *State) GetMemory() uint64
- func (x *State) GetStart() *timestamp.Timestamp
- func (x *State) GetStderr() string
- func (x *State) GetStdout() string
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type UnimplementedWorkerServer
- func (UnimplementedWorkerServer) CheckContainer(context.Context, *Container) (*State, error)
- func (UnimplementedWorkerServer) GetInfo(context.Context, *empty.Empty) (*Info, error)
- func (UnimplementedWorkerServer) RunContainer(context.Context, *Container) (*empty.Empty, error)
- func (UnimplementedWorkerServer) StopContainer(context.Context, *Container) (*empty.Empty, error)
- type UnsafeWorkerServer
- type Volume
- type WorkerClient
- type WorkerServer
Constants ¶
This section is empty.
Variables ¶
var File_proto_worker_proto protoreflect.FileDescriptor
var Worker_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Worker", HandlerType: (*WorkerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetInfo", Handler: _Worker_GetInfo_Handler, }, { MethodName: "RunContainer", Handler: _Worker_RunContainer_Handler, }, { MethodName: "CheckContainer", Handler: _Worker_CheckContainer_Handler, }, { MethodName: "StopContainer", Handler: _Worker_StopContainer_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/worker.proto", }
Worker_ServiceDesc is the grpc.ServiceDesc for Worker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWorkerServer ¶
func RegisterWorkerServer(s grpc.ServiceRegistrar, srv WorkerServer)
Types ¶
type Container ¶
type Container struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` Command []string `protobuf:"bytes,3,rep,name=command,proto3" json:"command,omitempty"` WorkDir string `protobuf:"bytes,4,opt,name=work_dir,json=workDir,proto3" json:"work_dir,omitempty"` Outputs []*Volume `protobuf:"bytes,5,rep,name=outputs,proto3" json:"outputs,omitempty"` Inputs []*Volume `protobuf:"bytes,6,rep,name=inputs,proto3" json:"inputs,omitempty"` Env map[string]string `` /* 147-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Container) Descriptor
deprecated
func (*Container) GetCommand ¶
func (*Container) GetOutputs ¶
func (*Container) GetWorkDir ¶
func (*Container) ProtoMessage ¶
func (*Container) ProtoMessage()
func (*Container) ProtoReflect ¶
func (x *Container) ProtoReflect() protoreflect.Message
type Info ¶
type Info struct { CpuCores int32 `protobuf:"varint,1,opt,name=cpu_cores,json=cpuCores,proto3" json:"cpu_cores,omitempty"` RamGb float64 `protobuf:"fixed64,2,opt,name=ram_gb,json=ramGb,proto3" json:"ram_gb,omitempty"` IdentifiedCpuCores int32 `protobuf:"varint,3,opt,name=identified_cpu_cores,json=identifiedCpuCores,proto3" json:"identified_cpu_cores,omitempty"` IdentifiedRamGb float64 `protobuf:"fixed64,4,opt,name=identified_ram_gb,json=identifiedRamGb,proto3" json:"identified_ram_gb,omitempty"` // contains filtered or unexported fields }
func (*Info) Descriptor
deprecated
func (*Info) GetCpuCores ¶
func (*Info) GetIdentifiedCpuCores ¶
func (*Info) GetIdentifiedRamGb ¶
func (*Info) ProtoMessage ¶
func (*Info) ProtoMessage()
func (*Info) ProtoReflect ¶
func (x *Info) ProtoReflect() protoreflect.Message
type State ¶
type State struct { Exited bool `protobuf:"varint,1,opt,name=exited,proto3" json:"exited,omitempty"` ExitCode int32 `protobuf:"varint,2,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` Start *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start,proto3" json:"start,omitempty"` End *timestamp.Timestamp `protobuf:"bytes,4,opt,name=end,proto3" json:"end,omitempty"` Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"` Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"` CpuTime uint64 `protobuf:"varint,7,opt,name=cpu_time,json=cpuTime,proto3" json:"cpu_time,omitempty"` CpuPercent float64 `protobuf:"fixed64,8,opt,name=cpu_percent,json=cpuPercent,proto3" json:"cpu_percent,omitempty"` Memory uint64 `protobuf:"varint,9,opt,name=memory,proto3" json:"memory,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetCpuPercent ¶
func (*State) GetCpuTime ¶
func (*State) GetExitCode ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type UnimplementedWorkerServer ¶
type UnimplementedWorkerServer struct { }
UnimplementedWorkerServer must be embedded to have forward compatible implementations.
func (UnimplementedWorkerServer) CheckContainer ¶
func (UnimplementedWorkerServer) RunContainer ¶
func (UnimplementedWorkerServer) StopContainer ¶
type UnsafeWorkerServer ¶
type UnsafeWorkerServer interface {
// contains filtered or unexported methods
}
UnsafeWorkerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WorkerServer will result in compilation errors.
type Volume ¶
type Volume struct { HostPath string `protobuf:"bytes,1,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` ContainerPath string `protobuf:"bytes,2,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // contains filtered or unexported fields }
func (*Volume) Descriptor
deprecated
func (*Volume) GetContainerPath ¶
func (*Volume) GetHostPath ¶
func (*Volume) ProtoMessage ¶
func (*Volume) ProtoMessage()
func (*Volume) ProtoReflect ¶
func (x *Volume) ProtoReflect() protoreflect.Message
type WorkerClient ¶
type WorkerClient interface { GetInfo(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Info, error) RunContainer(ctx context.Context, in *Container, opts ...grpc.CallOption) (*empty.Empty, error) CheckContainer(ctx context.Context, in *Container, opts ...grpc.CallOption) (*State, error) StopContainer(ctx context.Context, in *Container, opts ...grpc.CallOption) (*empty.Empty, error) }
WorkerClient is the client API for Worker 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 NewWorkerClient ¶
func NewWorkerClient(cc grpc.ClientConnInterface) WorkerClient
type WorkerServer ¶
type WorkerServer interface { GetInfo(context.Context, *empty.Empty) (*Info, error) RunContainer(context.Context, *Container) (*empty.Empty, error) CheckContainer(context.Context, *Container) (*State, error) StopContainer(context.Context, *Container) (*empty.Empty, error) // contains filtered or unexported methods }
WorkerServer is the server API for Worker service. All implementations must embed UnimplementedWorkerServer for forward compatibility