Documentation ¶
Index ¶
- Variables
- func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer)
- type BackendClient
- type BackendServer
- type RgInfo
- func (*RgInfo) Descriptor() ([]byte, []int)deprecated
- func (x *RgInfo) GetCpuInfo() string
- func (x *RgInfo) GetIp() string
- func (x *RgInfo) GetLoad() float32
- func (x *RgInfo) GetMemInfo() string
- func (x *RgInfo) GetNodeId() string
- func (x *RgInfo) GetTasksAbnormalNumber() int32
- func (x *RgInfo) GetTasksNumber() int32
- func (x *RgInfo) GetTasksSuspendedNumber() int32
- func (*RgInfo) ProtoMessage()
- func (x *RgInfo) ProtoReflect() protoreflect.Message
- func (x *RgInfo) Reset()
- func (x *RgInfo) String() string
- type RgResp
- type SyncDataReq
- type SyncDataResp
- type UnimplementedBackendServer
- type UnsafeBackendServer
Constants ¶
This section is empty.
Variables ¶
var Backend_ServiceDesc = grpc.ServiceDesc{ ServiceName: "backend.Backend", HandlerType: (*BackendServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Backend_Register_Handler, }, { MethodName: "SyncData", Handler: _Backend_SyncData_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "backend/backend.proto", }
Backend_ServiceDesc is the grpc.ServiceDesc for Backend service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_backend_backend_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBackendServer ¶
func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer)
Types ¶
type BackendClient ¶
type BackendClient interface { Register(ctx context.Context, in *RgInfo, opts ...grpc.CallOption) (*RgResp, error) SyncData(ctx context.Context, in *SyncDataReq, opts ...grpc.CallOption) (*SyncDataResp, error) }
BackendClient is the client API for Backend 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 NewBackendClient ¶
func NewBackendClient(cc grpc.ClientConnInterface) BackendClient
type BackendServer ¶
type BackendServer interface { Register(context.Context, *RgInfo) (*RgResp, error) SyncData(context.Context, *SyncDataReq) (*SyncDataResp, error) }
BackendServer is the server API for Backend service. All implementations must embed UnimplementedBackendServer for forward compatibility
type RgInfo ¶
type RgInfo struct { NodeId string `protobuf:"bytes,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` TasksNumber int32 `protobuf:"varint,3,opt,name=tasksNumber,proto3" json:"tasksNumber,omitempty"` // 任务总数 TasksAbnormalNumber int32 `protobuf:"varint,4,opt,name=tasksAbnormalNumber,proto3" json:"tasksAbnormalNumber,omitempty"` // 异常任务数 TasksSuspendedNumber int32 `protobuf:"varint,5,opt,name=tasksSuspendedNumber,proto3" json:"tasksSuspendedNumber,omitempty"` // 暂停任务数 Load float32 `protobuf:"fixed32,6,opt,name=load,proto3" json:"load,omitempty"` CpuInfo string `protobuf:"bytes,7,opt,name=cpuInfo,proto3" json:"cpuInfo,omitempty"` MemInfo string `protobuf:"bytes,8,opt,name=memInfo,proto3" json:"memInfo,omitempty"` // contains filtered or unexported fields }
func (*RgInfo) Descriptor
deprecated
func (*RgInfo) GetCpuInfo ¶
func (*RgInfo) GetMemInfo ¶
func (*RgInfo) GetTasksAbnormalNumber ¶
func (*RgInfo) GetTasksNumber ¶
func (*RgInfo) GetTasksSuspendedNumber ¶
func (*RgInfo) ProtoMessage ¶
func (*RgInfo) ProtoMessage()
func (*RgInfo) ProtoReflect ¶
func (x *RgInfo) ProtoReflect() protoreflect.Message
type RgResp ¶
type RgResp struct { NodeId string `protobuf:"bytes,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` // contains filtered or unexported fields }
func (*RgResp) Descriptor
deprecated
func (*RgResp) ProtoMessage ¶
func (*RgResp) ProtoMessage()
func (*RgResp) ProtoReflect ¶
func (x *RgResp) ProtoReflect() protoreflect.Message
type SyncDataReq ¶
type SyncDataReq struct { NodeId string `protobuf:"bytes,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` // contains filtered or unexported fields }
func (*SyncDataReq) Descriptor
deprecated
func (*SyncDataReq) Descriptor() ([]byte, []int)
Deprecated: Use SyncDataReq.ProtoReflect.Descriptor instead.
func (*SyncDataReq) GetIp ¶
func (x *SyncDataReq) GetIp() string
func (*SyncDataReq) GetNodeId ¶
func (x *SyncDataReq) GetNodeId() string
func (*SyncDataReq) ProtoMessage ¶
func (*SyncDataReq) ProtoMessage()
func (*SyncDataReq) ProtoReflect ¶
func (x *SyncDataReq) ProtoReflect() protoreflect.Message
func (*SyncDataReq) Reset ¶
func (x *SyncDataReq) Reset()
func (*SyncDataReq) String ¶
func (x *SyncDataReq) String() string
type SyncDataResp ¶
type SyncDataResp struct { Tasks []*common.TaskInfo `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"` // contains filtered or unexported fields }
func (*SyncDataResp) Descriptor
deprecated
func (*SyncDataResp) Descriptor() ([]byte, []int)
Deprecated: Use SyncDataResp.ProtoReflect.Descriptor instead.
func (*SyncDataResp) GetTasks ¶
func (x *SyncDataResp) GetTasks() []*common.TaskInfo
func (*SyncDataResp) ProtoMessage ¶
func (*SyncDataResp) ProtoMessage()
func (*SyncDataResp) ProtoReflect ¶
func (x *SyncDataResp) ProtoReflect() protoreflect.Message
func (*SyncDataResp) Reset ¶
func (x *SyncDataResp) Reset()
func (*SyncDataResp) String ¶
func (x *SyncDataResp) String() string
type UnimplementedBackendServer ¶
type UnimplementedBackendServer struct { }
UnimplementedBackendServer must be embedded to have forward compatible implementations.
func (UnimplementedBackendServer) SyncData ¶
func (UnimplementedBackendServer) SyncData(context.Context, *SyncDataReq) (*SyncDataResp, error)
type UnsafeBackendServer ¶
type UnsafeBackendServer interface {
// contains filtered or unexported methods
}
UnsafeBackendServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BackendServer will result in compilation errors.