backend

package
v0.0.0-...-5808d2a Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use RgInfo.ProtoReflect.Descriptor instead.

func (*RgInfo) GetCpuInfo

func (x *RgInfo) GetCpuInfo() string

func (*RgInfo) GetIp

func (x *RgInfo) GetIp() string

func (*RgInfo) GetLoad

func (x *RgInfo) GetLoad() float32

func (*RgInfo) GetMemInfo

func (x *RgInfo) GetMemInfo() string

func (*RgInfo) GetNodeId

func (x *RgInfo) GetNodeId() string

func (*RgInfo) GetTasksAbnormalNumber

func (x *RgInfo) GetTasksAbnormalNumber() int32

func (*RgInfo) GetTasksNumber

func (x *RgInfo) GetTasksNumber() int32

func (*RgInfo) GetTasksSuspendedNumber

func (x *RgInfo) GetTasksSuspendedNumber() int32

func (*RgInfo) ProtoMessage

func (*RgInfo) ProtoMessage()

func (*RgInfo) ProtoReflect

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

func (*RgInfo) Reset

func (x *RgInfo) Reset()

func (*RgInfo) String

func (x *RgInfo) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use RgResp.ProtoReflect.Descriptor instead.

func (*RgResp) GetNodeId

func (x *RgResp) GetNodeId() string

func (*RgResp) ProtoMessage

func (*RgResp) ProtoMessage()

func (*RgResp) ProtoReflect

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

func (*RgResp) Reset

func (x *RgResp) Reset()

func (*RgResp) String

func (x *RgResp) String() string

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) Register

func (UnimplementedBackendServer) SyncData

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.

Jump to

Keyboard shortcuts

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