Documentation
¶
Index ¶
- Constants
- Variables
- func MarshalDistributedMessage(dm *models.DistributedMessage) ([]byte, error)
- func MarshalHubMessage(m *models.HubMessage) ([]byte, error)
- func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)
- func UnmarshalDistributedMessage(data []byte) (*models.DistributedMessage, error)
- func UnmarshalHubMessage(data []byte) (*models.HubMessage, error)
- type BatchDispatchRequest
- func (*BatchDispatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchDispatchRequest) GetItems() []*DispatchItem
- func (*BatchDispatchRequest) ProtoMessage()
- func (x *BatchDispatchRequest) ProtoReflect() protoreflect.Message
- func (x *BatchDispatchRequest) Reset()
- func (x *BatchDispatchRequest) String() string
- type BatchDispatchResponse
- func (*BatchDispatchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchDispatchResponse) GetResults() []*DispatchResult
- func (*BatchDispatchResponse) ProtoMessage()
- func (x *BatchDispatchResponse) ProtoReflect() protoreflect.Message
- func (x *BatchDispatchResponse) Reset()
- func (x *BatchDispatchResponse) String() string
- type BroadcastGroupRequest
- func (*BroadcastGroupRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BroadcastGroupRequest) GetExcludeSender() bool
- func (x *BroadcastGroupRequest) GetMessageData() []byte
- func (x *BroadcastGroupRequest) GetSenderId() string
- func (*BroadcastGroupRequest) ProtoMessage()
- func (x *BroadcastGroupRequest) ProtoReflect() protoreflect.Message
- func (x *BroadcastGroupRequest) Reset()
- func (x *BroadcastGroupRequest) String() string
- type BroadcastGroupResponse
- func (*BroadcastGroupResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BroadcastGroupResponse) GetDelivered() int32
- func (*BroadcastGroupResponse) ProtoMessage()
- func (x *BroadcastGroupResponse) ProtoReflect() protoreflect.Message
- func (x *BroadcastGroupResponse) Reset()
- func (x *BroadcastGroupResponse) String() string
- type CheckUsersOnlineRequest
- func (*CheckUsersOnlineRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CheckUsersOnlineRequest) GetUserIds() []string
- func (*CheckUsersOnlineRequest) ProtoMessage()
- func (x *CheckUsersOnlineRequest) ProtoReflect() protoreflect.Message
- func (x *CheckUsersOnlineRequest) Reset()
- func (x *CheckUsersOnlineRequest) String() string
- type CheckUsersOnlineResponse
- func (*CheckUsersOnlineResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CheckUsersOnlineResponse) GetOnlineUsers() map[string]bool
- func (*CheckUsersOnlineResponse) ProtoMessage()
- func (x *CheckUsersOnlineResponse) ProtoReflect() protoreflect.Message
- func (x *CheckUsersOnlineResponse) Reset()
- func (x *CheckUsersOnlineResponse) String() string
- type DispatchItem
- func (*DispatchItem) Descriptor() ([]byte, []int)deprecated
- func (x *DispatchItem) GetAppId() string
- func (x *DispatchItem) GetExcludeSender() bool
- func (x *DispatchItem) GetGroupIds() []string
- func (x *DispatchItem) GetMessageData() []byte
- func (x *DispatchItem) GetNamespace() string
- func (x *DispatchItem) GetOperation() DispatchOperation
- func (x *DispatchItem) GetReason() string
- func (x *DispatchItem) GetSenderId() string
- func (x *DispatchItem) GetTargetUserId() string
- func (x *DispatchItem) GetTraceId() string
- func (*DispatchItem) ProtoMessage()
- func (x *DispatchItem) ProtoReflect() protoreflect.Message
- func (x *DispatchItem) Reset()
- func (x *DispatchItem) String() string
- type DispatchOperation
- func (DispatchOperation) Descriptor() protoreflect.EnumDescriptor
- func (x DispatchOperation) Enum() *DispatchOperation
- func (DispatchOperation) EnumDescriptor() ([]byte, []int)deprecated
- func (x DispatchOperation) Number() protoreflect.EnumNumber
- func (x DispatchOperation) String() string
- func (DispatchOperation) Type() protoreflect.EnumType
- type DispatchResult
- func (*DispatchResult) Descriptor() ([]byte, []int)deprecated
- func (x *DispatchResult) GetCount() int32
- func (x *DispatchResult) GetError() string
- func (x *DispatchResult) GetSuccess() bool
- func (x *DispatchResult) GetUserOnline() bool
- func (*DispatchResult) ProtoMessage()
- func (x *DispatchResult) ProtoReflect() protoreflect.Message
- func (x *DispatchResult) Reset()
- func (x *DispatchResult) String() string
- type DistributedMessageProto
- func (*DistributedMessageProto) Descriptor() ([]byte, []int)deprecated
- func (x *DistributedMessageProto) GetExcludeSender() bool
- func (x *DistributedMessageProto) GetGroupIds() []string
- func (x *DistributedMessageProto) GetMessage() *HubMessageProto
- func (x *DistributedMessageProto) GetNamespace() string
- func (x *DistributedMessageProto) GetNodeId() string
- func (x *DistributedMessageProto) GetReason() string
- func (x *DistributedMessageProto) GetSenderId() string
- func (x *DistributedMessageProto) GetTargetId() string
- func (x *DistributedMessageProto) GetTimestamp() *timestamppb.Timestamp
- func (x *DistributedMessageProto) GetTraceId() string
- func (x *DistributedMessageProto) GetType() string
- func (*DistributedMessageProto) ProtoMessage()
- func (x *DistributedMessageProto) ProtoReflect() protoreflect.Message
- func (x *DistributedMessageProto) Reset()
- func (x *DistributedMessageProto) String() string
- type HubMessageProto
- func (*HubMessageProto) Descriptor() ([]byte, []int)deprecated
- func (x *HubMessageProto) GetBroadcastType() string
- func (x *HubMessageProto) GetContent() string
- func (x *HubMessageProto) GetCreateAt() *timestamppb.Timestamp
- func (x *HubMessageProto) GetData() *structpb.Struct
- func (x *HubMessageProto) GetGroupIds() []string
- func (x *HubMessageProto) GetId() string
- func (x *HubMessageProto) GetMessageId() string
- func (x *HubMessageProto) GetMessageType() string
- func (x *HubMessageProto) GetNamespace() string
- func (x *HubMessageProto) GetPriority() string
- func (x *HubMessageProto) GetPushType() string
- func (x *HubMessageProto) GetReceiver() string
- func (x *HubMessageProto) GetReceiverClient() string
- func (x *HubMessageProto) GetReceiverName() string
- func (x *HubMessageProto) GetReceiverNode() string
- func (x *HubMessageProto) GetReceiverType() string
- func (x *HubMessageProto) GetReplyToMsgId() string
- func (x *HubMessageProto) GetRequireAck() bool
- func (x *HubMessageProto) GetSender() string
- func (x *HubMessageProto) GetSenderClient() string
- func (x *HubMessageProto) GetSenderName() string
- func (x *HubMessageProto) GetSenderType() string
- func (x *HubMessageProto) GetSeqNo() int64
- func (x *HubMessageProto) GetSessionId() string
- func (x *HubMessageProto) GetSkipDatabaseStorage() bool
- func (x *HubMessageProto) GetSkipSendToClient() bool
- func (x *HubMessageProto) GetSource() string
- func (x *HubMessageProto) GetTraceId() string
- func (*HubMessageProto) ProtoMessage()
- func (x *HubMessageProto) ProtoReflect() protoreflect.Message
- func (x *HubMessageProto) Reset()
- func (x *HubMessageProto) String() string
- type KickUserRequest
- func (*KickUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *KickUserRequest) GetReason() string
- func (x *KickUserRequest) GetUserId() string
- func (*KickUserRequest) ProtoMessage()
- func (x *KickUserRequest) ProtoReflect() protoreflect.Message
- func (x *KickUserRequest) Reset()
- func (x *KickUserRequest) String() string
- type KickUserResponse
- func (*KickUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *KickUserResponse) GetKickedConnections() int32
- func (x *KickUserResponse) GetSuccess() bool
- func (*KickUserResponse) ProtoMessage()
- func (x *KickUserResponse) ProtoReflect() protoreflect.Message
- func (x *KickUserResponse) Reset()
- func (x *KickUserResponse) String() string
- type NodeInfoProto
- func (*NodeInfoProto) Descriptor() ([]byte, []int)deprecated
- func (x *NodeInfoProto) GetConnections() int64
- func (x *NodeInfoProto) GetId() string
- func (x *NodeInfoProto) GetIpAddress() string
- func (x *NodeInfoProto) GetLastSeen() *timestamppb.Timestamp
- func (x *NodeInfoProto) GetLoadScore() float64
- func (x *NodeInfoProto) GetPort() int32
- func (x *NodeInfoProto) GetStatus() string
- func (*NodeInfoProto) ProtoMessage()
- func (x *NodeInfoProto) ProtoReflect() protoreflect.Message
- func (x *NodeInfoProto) Reset()
- func (x *NodeInfoProto) String() string
- type NodeServiceClient
- type NodeServiceServer
- type NotifyObserversRequest
- func (*NotifyObserversRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NotifyObserversRequest) GetMessageData() []byte
- func (*NotifyObserversRequest) ProtoMessage()
- func (x *NotifyObserversRequest) ProtoReflect() protoreflect.Message
- func (x *NotifyObserversRequest) Reset()
- func (x *NotifyObserversRequest) String() string
- type NotifyObserversResponse
- func (*NotifyObserversResponse) Descriptor() ([]byte, []int)deprecated
- func (x *NotifyObserversResponse) GetNotified() int32
- func (*NotifyObserversResponse) ProtoMessage()
- func (x *NotifyObserversResponse) ProtoReflect() protoreflect.Message
- func (x *NotifyObserversResponse) Reset()
- func (x *NotifyObserversResponse) String() string
- type PingRequest
- type PingResponse
- func (*PingResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PingResponse) GetActiveConnections() int64
- func (x *PingResponse) GetHealthy() bool
- func (x *PingResponse) GetNodeId() string
- func (*PingResponse) ProtoMessage()
- func (x *PingResponse) ProtoReflect() protoreflect.Message
- func (x *PingResponse) Reset()
- func (x *PingResponse) String() string
- type SendToUserRequest
- func (*SendToUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendToUserRequest) GetMessageData() []byte
- func (x *SendToUserRequest) GetUserId() string
- func (*SendToUserRequest) ProtoMessage()
- func (x *SendToUserRequest) ProtoReflect() protoreflect.Message
- func (x *SendToUserRequest) Reset()
- func (x *SendToUserRequest) String() string
- type SendToUserResponse
- func (*SendToUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendToUserResponse) GetError() string
- func (x *SendToUserResponse) GetSuccess() bool
- func (x *SendToUserResponse) GetUserOnline() bool
- func (*SendToUserResponse) ProtoMessage()
- func (x *SendToUserResponse) ProtoReflect() protoreflect.Message
- func (x *SendToUserResponse) Reset()
- func (x *SendToUserResponse) String() string
- type UnimplementedNodeServiceServer
- func (UnimplementedNodeServiceServer) BatchDispatch(context.Context, *BatchDispatchRequest) (*BatchDispatchResponse, error)
- func (UnimplementedNodeServiceServer) BroadcastGroup(context.Context, *BroadcastGroupRequest) (*BroadcastGroupResponse, error)
- func (UnimplementedNodeServiceServer) CheckUsersOnline(context.Context, *CheckUsersOnlineRequest) (*CheckUsersOnlineResponse, error)
- func (UnimplementedNodeServiceServer) KickUser(context.Context, *KickUserRequest) (*KickUserResponse, error)
- func (UnimplementedNodeServiceServer) NotifyObservers(context.Context, *NotifyObserversRequest) (*NotifyObserversResponse, error)
- func (UnimplementedNodeServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
- func (UnimplementedNodeServiceServer) SendToUser(context.Context, *SendToUserRequest) (*SendToUserResponse, error)
- type UnsafeNodeServiceServer
Constants ¶
const ( NodeService_SendToUser_FullMethodName = "/wscpb.NodeService/SendToUser" NodeService_CheckUsersOnline_FullMethodName = "/wscpb.NodeService/CheckUsersOnline" NodeService_BroadcastGroup_FullMethodName = "/wscpb.NodeService/BroadcastGroup" NodeService_NotifyObservers_FullMethodName = "/wscpb.NodeService/NotifyObservers" NodeService_KickUser_FullMethodName = "/wscpb.NodeService/KickUser" NodeService_Ping_FullMethodName = "/wscpb.NodeService/Ping" NodeService_BatchDispatch_FullMethodName = "/wscpb.NodeService/BatchDispatch" )
Variables ¶
var ( DispatchOperation_name = map[int32]string{ 0: "DISPATCH_OPERATION_UNSPECIFIED", 1: "DISPATCH_SEND_MESSAGE", 2: "DISPATCH_KICK_USER", 3: "DISPATCH_GROUP_BROADCAST", 4: "DISPATCH_OBSERVER_NOTIFY", 5: "DISPATCH_BROADCAST", } DispatchOperation_value = map[string]int32{ "DISPATCH_OPERATION_UNSPECIFIED": 0, "DISPATCH_SEND_MESSAGE": 1, "DISPATCH_KICK_USER": 2, "DISPATCH_GROUP_BROADCAST": 3, "DISPATCH_OBSERVER_NOTIFY": 4, "DISPATCH_BROADCAST": 5, } )
Enum value maps for DispatchOperation.
var File_node_proto protoreflect.FileDescriptor
var File_wsc_proto protoreflect.FileDescriptor
var NodeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "wscpb.NodeService", HandlerType: (*NodeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendToUser", Handler: _NodeService_SendToUser_Handler, }, { MethodName: "CheckUsersOnline", Handler: _NodeService_CheckUsersOnline_Handler, }, { MethodName: "BroadcastGroup", Handler: _NodeService_BroadcastGroup_Handler, }, { MethodName: "NotifyObservers", Handler: _NodeService_NotifyObservers_Handler, }, { MethodName: "KickUser", Handler: _NodeService_KickUser_Handler, }, { MethodName: "Ping", Handler: _NodeService_Ping_Handler, }, { MethodName: "BatchDispatch", Handler: _NodeService_BatchDispatch_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "node.proto", }
NodeService_ServiceDesc is the grpc.ServiceDesc for NodeService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func MarshalDistributedMessage ¶
func MarshalDistributedMessage(dm *models.DistributedMessage) ([]byte, error)
MarshalDistributedMessage 将 DistributedMessage 序列化为 protobuf 二进制 相比 JSON 体积减少 50%+,序列化速度提升 3-5x
func MarshalHubMessage ¶
func MarshalHubMessage(m *models.HubMessage) ([]byte, error)
MarshalHubMessage 将 HubMessage 序列化为 protobuf 二进制
func RegisterNodeServiceServer ¶
func RegisterNodeServiceServer(s grpc.ServiceRegistrar, srv NodeServiceServer)
func UnmarshalDistributedMessage ¶
func UnmarshalDistributedMessage(data []byte) (*models.DistributedMessage, error)
UnmarshalDistributedMessage 从 protobuf 二进制反序列化 DistributedMessage
func UnmarshalHubMessage ¶
func UnmarshalHubMessage(data []byte) (*models.HubMessage, error)
UnmarshalHubMessage 从 protobuf 二进制反序列化 HubMessage
Types ¶
type BatchDispatchRequest ¶
type BatchDispatchRequest struct {
Items []*DispatchItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // 待投递指令列表 | [EN] Dispatch instructions
// contains filtered or unexported fields
}
BatchDispatchRequest 微批投递请求(多条指令合帧) [EN] Micro-batch dispatch request
func (*BatchDispatchRequest) Descriptor
deprecated
func (*BatchDispatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchDispatchRequest.ProtoReflect.Descriptor instead.
func (*BatchDispatchRequest) GetItems ¶
func (x *BatchDispatchRequest) GetItems() []*DispatchItem
func (*BatchDispatchRequest) ProtoMessage ¶
func (*BatchDispatchRequest) ProtoMessage()
func (*BatchDispatchRequest) ProtoReflect ¶
func (x *BatchDispatchRequest) ProtoReflect() protoreflect.Message
func (*BatchDispatchRequest) Reset ¶
func (x *BatchDispatchRequest) Reset()
func (*BatchDispatchRequest) String ¶
func (x *BatchDispatchRequest) String() string
type BatchDispatchResponse ¶
type BatchDispatchResponse struct {
Results []*DispatchResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` // 逐条结果 | [EN] Per-item results
// contains filtered or unexported fields
}
BatchDispatchResponse 微批投递响应(结果与请求 items 一一对应) [EN] Micro-batch dispatch response
func (*BatchDispatchResponse) Descriptor
deprecated
func (*BatchDispatchResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchDispatchResponse.ProtoReflect.Descriptor instead.
func (*BatchDispatchResponse) GetResults ¶
func (x *BatchDispatchResponse) GetResults() []*DispatchResult
func (*BatchDispatchResponse) ProtoMessage ¶
func (*BatchDispatchResponse) ProtoMessage()
func (*BatchDispatchResponse) ProtoReflect ¶
func (x *BatchDispatchResponse) ProtoReflect() protoreflect.Message
func (*BatchDispatchResponse) Reset ¶
func (x *BatchDispatchResponse) Reset()
func (*BatchDispatchResponse) String ¶
func (x *BatchDispatchResponse) String() string
type BroadcastGroupRequest ¶
type BroadcastGroupRequest struct {
MessageData []byte `protobuf:"bytes,1,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` // 序列化后的 HubMessageProto | [EN] Serialized HubMessageProto
ExcludeSender bool `protobuf:"varint,2,opt,name=exclude_sender,json=excludeSender,proto3" json:"exclude_sender,omitempty"` // 是否排除发送者 | [EN] Whether to exclude sender
SenderId string `protobuf:"bytes,3,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` // 发送者用户ID(用于排除) | [EN] Sender user ID (for exclusion)
// contains filtered or unexported fields
}
BroadcastGroupRequest 群组广播请求 路由元数据(namespace, group_ids)通过 gRPC metadata 传递,参见文件头注释 [EN] Group broadcast request. Routing metadata via gRPC metadata headers, see file header.
func (*BroadcastGroupRequest) Descriptor
deprecated
func (*BroadcastGroupRequest) Descriptor() ([]byte, []int)
Deprecated: Use BroadcastGroupRequest.ProtoReflect.Descriptor instead.
func (*BroadcastGroupRequest) GetExcludeSender ¶
func (x *BroadcastGroupRequest) GetExcludeSender() bool
func (*BroadcastGroupRequest) GetMessageData ¶
func (x *BroadcastGroupRequest) GetMessageData() []byte
func (*BroadcastGroupRequest) GetSenderId ¶
func (x *BroadcastGroupRequest) GetSenderId() string
func (*BroadcastGroupRequest) ProtoMessage ¶
func (*BroadcastGroupRequest) ProtoMessage()
func (*BroadcastGroupRequest) ProtoReflect ¶
func (x *BroadcastGroupRequest) ProtoReflect() protoreflect.Message
func (*BroadcastGroupRequest) Reset ¶
func (x *BroadcastGroupRequest) Reset()
func (*BroadcastGroupRequest) String ¶
func (x *BroadcastGroupRequest) String() string
type BroadcastGroupResponse ¶
type BroadcastGroupResponse struct {
Delivered int32 `protobuf:"varint,1,opt,name=delivered,proto3" json:"delivered,omitempty"` // 本节点投递数量 | [EN] Delivered count on this node
// contains filtered or unexported fields
}
BroadcastGroupResponse 群组广播响应 [EN] Group broadcast response
func (*BroadcastGroupResponse) Descriptor
deprecated
func (*BroadcastGroupResponse) Descriptor() ([]byte, []int)
Deprecated: Use BroadcastGroupResponse.ProtoReflect.Descriptor instead.
func (*BroadcastGroupResponse) GetDelivered ¶
func (x *BroadcastGroupResponse) GetDelivered() int32
func (*BroadcastGroupResponse) ProtoMessage ¶
func (*BroadcastGroupResponse) ProtoMessage()
func (*BroadcastGroupResponse) ProtoReflect ¶
func (x *BroadcastGroupResponse) ProtoReflect() protoreflect.Message
func (*BroadcastGroupResponse) Reset ¶
func (x *BroadcastGroupResponse) Reset()
func (*BroadcastGroupResponse) String ¶
func (x *BroadcastGroupResponse) String() string
type CheckUsersOnlineRequest ¶
type CheckUsersOnlineRequest struct {
UserIds []string `protobuf:"bytes,1,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"` // 待检查的用户ID列表 | [EN] User IDs to check
// contains filtered or unexported fields
}
CheckUsersOnlineRequest 批量检查在线状态请求 [EN] Batch online check request
func (*CheckUsersOnlineRequest) Descriptor
deprecated
func (*CheckUsersOnlineRequest) Descriptor() ([]byte, []int)
Deprecated: Use CheckUsersOnlineRequest.ProtoReflect.Descriptor instead.
func (*CheckUsersOnlineRequest) GetUserIds ¶
func (x *CheckUsersOnlineRequest) GetUserIds() []string
func (*CheckUsersOnlineRequest) ProtoMessage ¶
func (*CheckUsersOnlineRequest) ProtoMessage()
func (*CheckUsersOnlineRequest) ProtoReflect ¶
func (x *CheckUsersOnlineRequest) ProtoReflect() protoreflect.Message
func (*CheckUsersOnlineRequest) Reset ¶
func (x *CheckUsersOnlineRequest) Reset()
func (*CheckUsersOnlineRequest) String ¶
func (x *CheckUsersOnlineRequest) String() string
type CheckUsersOnlineResponse ¶
type CheckUsersOnlineResponse struct {
OnlineUsers map[string]bool `` // userID → 是否在本节点在线 | [EN] userID → online on this node
/* 169-byte string literal not displayed */
// contains filtered or unexported fields
}
CheckUsersOnlineResponse 批量检查在线状态响应 [EN] Batch online check response
func (*CheckUsersOnlineResponse) Descriptor
deprecated
func (*CheckUsersOnlineResponse) Descriptor() ([]byte, []int)
Deprecated: Use CheckUsersOnlineResponse.ProtoReflect.Descriptor instead.
func (*CheckUsersOnlineResponse) GetOnlineUsers ¶
func (x *CheckUsersOnlineResponse) GetOnlineUsers() map[string]bool
func (*CheckUsersOnlineResponse) ProtoMessage ¶
func (*CheckUsersOnlineResponse) ProtoMessage()
func (*CheckUsersOnlineResponse) ProtoReflect ¶
func (x *CheckUsersOnlineResponse) ProtoReflect() protoreflect.Message
func (*CheckUsersOnlineResponse) Reset ¶
func (x *CheckUsersOnlineResponse) Reset()
func (*CheckUsersOnlineResponse) String ¶
func (x *CheckUsersOnlineResponse) String() string
type DispatchItem ¶
type DispatchItem struct {
Operation DispatchOperation `protobuf:"varint,1,opt,name=operation,proto3,enum=wscpb.DispatchOperation" json:"operation,omitempty"` // 操作类型 | [EN] Operation type
AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // 路由信封 appID(最上层隔离维度)| [EN] Routing envelope appID
Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"` // 路由信封 namespace(空=全局/通配)| [EN] Routing envelope namespace
GroupIds []string `protobuf:"bytes,4,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` // 路由信封 groupIDs(群组维度)| [EN] Routing envelope group IDs
TargetUserId string `protobuf:"bytes,5,opt,name=target_user_id,json=targetUserId,proto3" json:"target_user_id,omitempty"` // 目标用户(send_message/kick_user 使用)| [EN] Target user ID
Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"` // 辅助信息(kick_user 踢人原因)| [EN] Auxiliary info (kick reason)
MessageData []byte `protobuf:"bytes,7,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` // 序列化后的 HubMessageProto | [EN] Serialized HubMessageProto
ExcludeSender bool `protobuf:"varint,8,opt,name=exclude_sender,json=excludeSender,proto3" json:"exclude_sender,omitempty"` // 群组广播是否排除发送者 | [EN] Whether to exclude sender
SenderId string `protobuf:"bytes,9,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` // 发送者用户ID(用于排除)| [EN] Sender user ID (for exclusion)
TraceId string `protobuf:"bytes,10,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // 全链路追踪ID(每条 item 各自携带,跨节点串联日志)| [EN] Trace ID for full-link correlation
// contains filtered or unexported fields
}
DispatchItem 单条跨节点投递指令(微批合帧最小单元) 路由信封(app_id / namespace / group_ids)内嵌于指令体, 不依赖 gRPC metadata,支持同批多租户 / 多群组异构合帧 [EN] A single inter-node delivery instruction (micro-batch unit). Routing envelope embedded.
func (*DispatchItem) Descriptor
deprecated
func (*DispatchItem) Descriptor() ([]byte, []int)
Deprecated: Use DispatchItem.ProtoReflect.Descriptor instead.
func (*DispatchItem) GetAppId ¶
func (x *DispatchItem) GetAppId() string
func (*DispatchItem) GetExcludeSender ¶
func (x *DispatchItem) GetExcludeSender() bool
func (*DispatchItem) GetGroupIds ¶
func (x *DispatchItem) GetGroupIds() []string
func (*DispatchItem) GetMessageData ¶
func (x *DispatchItem) GetMessageData() []byte
func (*DispatchItem) GetNamespace ¶
func (x *DispatchItem) GetNamespace() string
func (*DispatchItem) GetOperation ¶
func (x *DispatchItem) GetOperation() DispatchOperation
func (*DispatchItem) GetReason ¶
func (x *DispatchItem) GetReason() string
func (*DispatchItem) GetSenderId ¶
func (x *DispatchItem) GetSenderId() string
func (*DispatchItem) GetTargetUserId ¶
func (x *DispatchItem) GetTargetUserId() string
func (*DispatchItem) GetTraceId ¶
func (x *DispatchItem) GetTraceId() string
func (*DispatchItem) ProtoMessage ¶
func (*DispatchItem) ProtoMessage()
func (*DispatchItem) ProtoReflect ¶
func (x *DispatchItem) ProtoReflect() protoreflect.Message
func (*DispatchItem) Reset ¶
func (x *DispatchItem) Reset()
func (*DispatchItem) String ¶
func (x *DispatchItem) String() string
type DispatchOperation ¶
type DispatchOperation int32
DispatchOperation 微批投递操作类型(替代裸字符串,枚举语义 + 线型 varint 紧凑编码) [EN] Micro-batch delivery operation type (enum instead of raw string).
const ( DispatchOperation_DISPATCH_OPERATION_UNSPECIFIED DispatchOperation = 0 // 未指定(默认值,非法操作)| [EN] Unspecified (default, invalid) DispatchOperation_DISPATCH_SEND_MESSAGE DispatchOperation = 1 // 点对点投递 | [EN] Point-to-point delivery DispatchOperation_DISPATCH_KICK_USER DispatchOperation = 2 // 踢人 | [EN] Kick user DispatchOperation_DISPATCH_GROUP_BROADCAST DispatchOperation = 3 // 群组广播(单群组语义,多群组由发送端拆分为多条 item)| [EN] Group broadcast (single-group) DispatchOperation_DISPATCH_OBSERVER_NOTIFY DispatchOperation = 4 // 观察者通知 | [EN] Observer notification DispatchOperation_DISPATCH_BROADCAST DispatchOperation = 5 // 全局/命名空间广播 | [EN] Global/namespace broadcast )
func (DispatchOperation) Descriptor ¶
func (DispatchOperation) Descriptor() protoreflect.EnumDescriptor
func (DispatchOperation) Enum ¶
func (x DispatchOperation) Enum() *DispatchOperation
func (DispatchOperation) EnumDescriptor
deprecated
func (DispatchOperation) EnumDescriptor() ([]byte, []int)
Deprecated: Use DispatchOperation.Descriptor instead.
func (DispatchOperation) Number ¶
func (x DispatchOperation) Number() protoreflect.EnumNumber
func (DispatchOperation) String ¶
func (x DispatchOperation) String() string
func (DispatchOperation) Type ¶
func (DispatchOperation) Type() protoreflect.EnumType
type DispatchResult ¶
type DispatchResult struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // send_message: 是否投递成功; kick_user: 是否成功 | [EN] Whether succeeded
UserOnline bool `protobuf:"varint,2,opt,name=user_online,json=userOnline,proto3" json:"user_online,omitempty"` // send_message 专用: 用户是否在线 | [EN] Whether user online (send only)
Count int32 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` // 投递数/踢出连接数/通知数 | [EN] delivered/kicked/notified count
Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // 失败原因(成功时为空)| [EN] Failure reason (empty on success)
// contains filtered or unexported fields
}
DispatchResult 单条投递结果(与 DispatchItem 一一对应) [EN] Per-item dispatch result
func (*DispatchResult) Descriptor
deprecated
func (*DispatchResult) Descriptor() ([]byte, []int)
Deprecated: Use DispatchResult.ProtoReflect.Descriptor instead.
func (*DispatchResult) GetCount ¶
func (x *DispatchResult) GetCount() int32
func (*DispatchResult) GetError ¶
func (x *DispatchResult) GetError() string
func (*DispatchResult) GetSuccess ¶
func (x *DispatchResult) GetSuccess() bool
func (*DispatchResult) GetUserOnline ¶
func (x *DispatchResult) GetUserOnline() bool
func (*DispatchResult) ProtoMessage ¶
func (*DispatchResult) ProtoMessage()
func (*DispatchResult) ProtoReflect ¶
func (x *DispatchResult) ProtoReflect() protoreflect.Message
func (*DispatchResult) Reset ¶
func (x *DispatchResult) Reset()
func (*DispatchResult) String ¶
func (x *DispatchResult) String() string
type DistributedMessageProto ¶
type DistributedMessageProto struct {
Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // 操作类型 | [EN] Operation Type
NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // 源节点ID | [EN] Source Node ID
TargetId string `protobuf:"bytes,3,opt,name=target_id,json=targetId,proto3" json:"target_id,omitempty"` // 目标ID(用户ID、节点ID等) | [EN] Target ID
TraceId string `protobuf:"bytes,9,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // 全链路追踪ID | [EN] Trace ID
Message *HubMessageProto `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` // 消息数据 | [EN] Message Data
Reason string `protobuf:"bytes,5,opt,name=reason,proto3" json:"reason,omitempty"` // 原因 | [EN] Reason
Timestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // 时间戳 | [EN] Timestamp
Namespace string `protobuf:"bytes,7,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间ID(路由信封携带,空=全命名空间广播) | [EN] Namespace ID
GroupIds []string `protobuf:"bytes,8,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` // 群组ID列表(支持多群组,观察者可订阅多个组) | [EN] Group IDs
ExcludeSender bool `protobuf:"varint,10,opt,name=exclude_sender,json=excludeSender,proto3" json:"exclude_sender,omitempty"` // 是否排除发送者(跨节点群组广播 PubSub 兜底携带,与 gRPC BroadcastGroupRequest 对齐) | [EN] Exclude Sender
SenderId string `protobuf:"bytes,11,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` // 发送者ID(排除发送者时用,跨节点 PubSub 兜底场景) | [EN] Sender ID
// contains filtered or unexported fields
}
DistributedMessageProto 分布式消息(跨节点传输包装) 路由信封:跨节点 PubSub 链路在 DistributedMessage 层携带 namespace/group_ids; HubMessage 自身也携带路由信封(field 27/28),用于本地异步队列消费时恢复路由 [EN] DistributedMessageProto is the protobuf representation of a Distributed message.
func (*DistributedMessageProto) Descriptor
deprecated
func (*DistributedMessageProto) Descriptor() ([]byte, []int)
Deprecated: Use DistributedMessageProto.ProtoReflect.Descriptor instead.
func (*DistributedMessageProto) GetExcludeSender ¶
func (x *DistributedMessageProto) GetExcludeSender() bool
func (*DistributedMessageProto) GetGroupIds ¶
func (x *DistributedMessageProto) GetGroupIds() []string
func (*DistributedMessageProto) GetMessage ¶
func (x *DistributedMessageProto) GetMessage() *HubMessageProto
func (*DistributedMessageProto) GetNamespace ¶
func (x *DistributedMessageProto) GetNamespace() string
func (*DistributedMessageProto) GetNodeId ¶
func (x *DistributedMessageProto) GetNodeId() string
func (*DistributedMessageProto) GetReason ¶
func (x *DistributedMessageProto) GetReason() string
func (*DistributedMessageProto) GetSenderId ¶
func (x *DistributedMessageProto) GetSenderId() string
func (*DistributedMessageProto) GetTargetId ¶
func (x *DistributedMessageProto) GetTargetId() string
func (*DistributedMessageProto) GetTimestamp ¶
func (x *DistributedMessageProto) GetTimestamp() *timestamppb.Timestamp
func (*DistributedMessageProto) GetTraceId ¶
func (x *DistributedMessageProto) GetTraceId() string
func (*DistributedMessageProto) GetType ¶
func (x *DistributedMessageProto) GetType() string
func (*DistributedMessageProto) ProtoMessage ¶
func (*DistributedMessageProto) ProtoMessage()
func (*DistributedMessageProto) ProtoReflect ¶
func (x *DistributedMessageProto) ProtoReflect() protoreflect.Message
func (*DistributedMessageProto) Reset ¶
func (x *DistributedMessageProto) Reset()
func (*DistributedMessageProto) String ¶
func (x *DistributedMessageProto) String() string
type HubMessageProto ¶
type HubMessageProto struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 消息ID | [EN] Message ID
TraceId string `protobuf:"bytes,26,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // 全链路追踪ID | [EN] Trace ID
MessageType string `protobuf:"bytes,2,opt,name=message_type,json=messageType,proto3" json:"message_type,omitempty"` // 消息类型 | [EN] Message Type
Sender string `protobuf:"bytes,3,opt,name=sender,proto3" json:"sender,omitempty"` // 发送者 | [EN] Sender
SenderName string `protobuf:"bytes,4,opt,name=sender_name,json=senderName,proto3" json:"sender_name,omitempty"` // 发送者名称 | [EN] Sender Name
SenderType string `protobuf:"bytes,5,opt,name=sender_type,json=senderType,proto3" json:"sender_type,omitempty"` // 发送者类型 | [EN] Sender Type
SenderClient string `protobuf:"bytes,6,opt,name=sender_client,json=senderClient,proto3" json:"sender_client,omitempty"` // 发送者客户端 | [EN] Sender Client
Receiver string `protobuf:"bytes,7,opt,name=receiver,proto3" json:"receiver,omitempty"` // 接收者 | [EN] Receiver
ReceiverName string `protobuf:"bytes,8,opt,name=receiver_name,json=receiverName,proto3" json:"receiver_name,omitempty"` // 接收者名称 | [EN] Receiver Name
ReceiverType string `protobuf:"bytes,9,opt,name=receiver_type,json=receiverType,proto3" json:"receiver_type,omitempty"` // 接收者类型 | [EN] Receiver Type
ReceiverClient string `protobuf:"bytes,10,opt,name=receiver_client,json=receiverClient,proto3" json:"receiver_client,omitempty"` // 接收者客户端 | [EN] Receiver Client
ReceiverNode string `protobuf:"bytes,11,opt,name=receiver_node,json=receiverNode,proto3" json:"receiver_node,omitempty"` // 接收者节点 | [EN] Receiver Node
SessionId string `protobuf:"bytes,12,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // 会话ID | [EN] Session ID
Content string `protobuf:"bytes,13,opt,name=content,proto3" json:"content,omitempty"` // 消息内容 | [EN] Content
Data *structpb.Struct `protobuf:"bytes,14,opt,name=data,proto3" json:"data,omitempty"` // 数据 | [EN] Data
CreateAt *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=create_at,json=createAt,proto3" json:"create_at,omitempty"` // 创建时间 | [EN] Create At
MessageId string `protobuf:"bytes,16,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` // 消息ID | [EN] Message ID
SeqNo int64 `protobuf:"varint,17,opt,name=seq_no,json=seqNo,proto3" json:"seq_no,omitempty"` // 序列号 | [EN] Seq No
Priority string `protobuf:"bytes,18,opt,name=priority,proto3" json:"priority,omitempty"` // 优先级 | [EN] Priority
ReplyToMsgId string `protobuf:"bytes,19,opt,name=reply_to_msg_id,json=replyToMsgId,proto3" json:"reply_to_msg_id,omitempty"` // 回复消息ID | [EN] Reply To Msg ID
RequireAck bool `protobuf:"varint,20,opt,name=require_ack,json=requireAck,proto3" json:"require_ack,omitempty"` // 是否需要确认 | [EN] Require Ack
Source string `protobuf:"bytes,21,opt,name=source,proto3" json:"source,omitempty"` // 源节点ID | [EN] Source Node ID
PushType string `protobuf:"bytes,22,opt,name=push_type,json=pushType,proto3" json:"push_type,omitempty"` // 推送类型 | [EN] Push Type
BroadcastType string `protobuf:"bytes,23,opt,name=broadcast_type,json=broadcastType,proto3" json:"broadcast_type,omitempty"` // 广播类型 | [EN] Broadcast Type
SkipDatabaseStorage bool `protobuf:"varint,24,opt,name=skip_database_storage,json=skipDatabaseStorage,proto3" json:"skip_database_storage,omitempty"` // 是否跳过数据库存储 | [EN] Skip Database Storage
SkipSendToClient bool `protobuf:"varint,25,opt,name=skip_send_to_client,json=skipSendToClient,proto3" json:"skip_send_to_client,omitempty"` // 是否跳过发送到客户端 | [EN] Skip Send To Client
Namespace string `protobuf:"bytes,27,opt,name=namespace,proto3" json:"namespace,omitempty"` // 命名空间ID(路由信封,投递精确隔离用) | [EN] Namespace (routing envelope)
GroupIds []string `protobuf:"bytes,28,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` // 群组ID列表(路由信封,P2P为空) | [EN] Group IDs (routing envelope)
// contains filtered or unexported fields
}
HubMessageProto Hub 消息的 protobuf 表示(用于跨节点高效传输) [EN] HubMessageProto is the protobuf representation of a Hub message.
func (*HubMessageProto) Descriptor
deprecated
func (*HubMessageProto) Descriptor() ([]byte, []int)
Deprecated: Use HubMessageProto.ProtoReflect.Descriptor instead.
func (*HubMessageProto) GetBroadcastType ¶
func (x *HubMessageProto) GetBroadcastType() string
func (*HubMessageProto) GetContent ¶
func (x *HubMessageProto) GetContent() string
func (*HubMessageProto) GetCreateAt ¶
func (x *HubMessageProto) GetCreateAt() *timestamppb.Timestamp
func (*HubMessageProto) GetData ¶
func (x *HubMessageProto) GetData() *structpb.Struct
func (*HubMessageProto) GetGroupIds ¶
func (x *HubMessageProto) GetGroupIds() []string
func (*HubMessageProto) GetId ¶
func (x *HubMessageProto) GetId() string
func (*HubMessageProto) GetMessageId ¶
func (x *HubMessageProto) GetMessageId() string
func (*HubMessageProto) GetMessageType ¶
func (x *HubMessageProto) GetMessageType() string
func (*HubMessageProto) GetNamespace ¶
func (x *HubMessageProto) GetNamespace() string
func (*HubMessageProto) GetPriority ¶
func (x *HubMessageProto) GetPriority() string
func (*HubMessageProto) GetPushType ¶
func (x *HubMessageProto) GetPushType() string
func (*HubMessageProto) GetReceiver ¶
func (x *HubMessageProto) GetReceiver() string
func (*HubMessageProto) GetReceiverClient ¶
func (x *HubMessageProto) GetReceiverClient() string
func (*HubMessageProto) GetReceiverName ¶
func (x *HubMessageProto) GetReceiverName() string
func (*HubMessageProto) GetReceiverNode ¶
func (x *HubMessageProto) GetReceiverNode() string
func (*HubMessageProto) GetReceiverType ¶
func (x *HubMessageProto) GetReceiverType() string
func (*HubMessageProto) GetReplyToMsgId ¶
func (x *HubMessageProto) GetReplyToMsgId() string
func (*HubMessageProto) GetRequireAck ¶
func (x *HubMessageProto) GetRequireAck() bool
func (*HubMessageProto) GetSender ¶
func (x *HubMessageProto) GetSender() string
func (*HubMessageProto) GetSenderClient ¶
func (x *HubMessageProto) GetSenderClient() string
func (*HubMessageProto) GetSenderName ¶
func (x *HubMessageProto) GetSenderName() string
func (*HubMessageProto) GetSenderType ¶
func (x *HubMessageProto) GetSenderType() string
func (*HubMessageProto) GetSeqNo ¶
func (x *HubMessageProto) GetSeqNo() int64
func (*HubMessageProto) GetSessionId ¶
func (x *HubMessageProto) GetSessionId() string
func (*HubMessageProto) GetSkipDatabaseStorage ¶
func (x *HubMessageProto) GetSkipDatabaseStorage() bool
func (*HubMessageProto) GetSkipSendToClient ¶
func (x *HubMessageProto) GetSkipSendToClient() bool
func (*HubMessageProto) GetSource ¶
func (x *HubMessageProto) GetSource() string
func (*HubMessageProto) GetTraceId ¶
func (x *HubMessageProto) GetTraceId() string
func (*HubMessageProto) ProtoMessage ¶
func (*HubMessageProto) ProtoMessage()
func (*HubMessageProto) ProtoReflect ¶
func (x *HubMessageProto) ProtoReflect() protoreflect.Message
func (*HubMessageProto) Reset ¶
func (x *HubMessageProto) Reset()
func (*HubMessageProto) String ¶
func (x *HubMessageProto) String() string
type KickUserRequest ¶
type KickUserRequest struct {
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 目标用户ID | [EN] Target user ID
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` // 踢出原因 | [EN] Kick reason
// contains filtered or unexported fields
}
KickUserRequest 踢人请求 [EN] Kick user request
func (*KickUserRequest) Descriptor
deprecated
func (*KickUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use KickUserRequest.ProtoReflect.Descriptor instead.
func (*KickUserRequest) GetReason ¶
func (x *KickUserRequest) GetReason() string
func (*KickUserRequest) GetUserId ¶
func (x *KickUserRequest) GetUserId() string
func (*KickUserRequest) ProtoMessage ¶
func (*KickUserRequest) ProtoMessage()
func (*KickUserRequest) ProtoReflect ¶
func (x *KickUserRequest) ProtoReflect() protoreflect.Message
func (*KickUserRequest) Reset ¶
func (x *KickUserRequest) Reset()
func (*KickUserRequest) String ¶
func (x *KickUserRequest) String() string
type KickUserResponse ¶
type KickUserResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否成功 | [EN] Whether kick succeeded
KickedConnections int32 `protobuf:"varint,2,opt,name=kicked_connections,json=kickedConnections,proto3" json:"kicked_connections,omitempty"` // 踢出的连接数 | [EN] Kicked connection count
// contains filtered or unexported fields
}
KickUserResponse 踢人响应 [EN] Kick user response
func (*KickUserResponse) Descriptor
deprecated
func (*KickUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use KickUserResponse.ProtoReflect.Descriptor instead.
func (*KickUserResponse) GetKickedConnections ¶
func (x *KickUserResponse) GetKickedConnections() int32
func (*KickUserResponse) GetSuccess ¶
func (x *KickUserResponse) GetSuccess() bool
func (*KickUserResponse) ProtoMessage ¶
func (*KickUserResponse) ProtoMessage()
func (*KickUserResponse) ProtoReflect ¶
func (x *KickUserResponse) ProtoReflect() protoreflect.Message
func (*KickUserResponse) Reset ¶
func (x *KickUserResponse) Reset()
func (*KickUserResponse) String ¶
func (x *KickUserResponse) String() string
type NodeInfoProto ¶
type NodeInfoProto struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // 节点ID | [EN] Node ID
IpAddress string `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"` // IP地址 | [EN] IP Address
Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` // 端口号 | [EN] Port
Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` // 状态 | [EN] Status
LoadScore float64 `protobuf:"fixed64,5,opt,name=load_score,json=loadScore,proto3" json:"load_score,omitempty"` // 负载分数 | [EN] Load Score
LastSeen *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"` // 最后一次看到时间 | [EN] Last Seen
Connections int64 `protobuf:"varint,7,opt,name=connections,proto3" json:"connections,omitempty"` // 连接数 | [EN] Connections
// contains filtered or unexported fields
}
NodeInfoProto 节点信息(用于 Redis 存储和跨节点发现) [EN] NodeInfoProto is the protobuf representation of a Node info.
func (*NodeInfoProto) Descriptor
deprecated
func (*NodeInfoProto) Descriptor() ([]byte, []int)
Deprecated: Use NodeInfoProto.ProtoReflect.Descriptor instead.
func (*NodeInfoProto) GetConnections ¶
func (x *NodeInfoProto) GetConnections() int64
func (*NodeInfoProto) GetId ¶
func (x *NodeInfoProto) GetId() string
func (*NodeInfoProto) GetIpAddress ¶
func (x *NodeInfoProto) GetIpAddress() string
func (*NodeInfoProto) GetLastSeen ¶
func (x *NodeInfoProto) GetLastSeen() *timestamppb.Timestamp
func (*NodeInfoProto) GetLoadScore ¶
func (x *NodeInfoProto) GetLoadScore() float64
func (*NodeInfoProto) GetPort ¶
func (x *NodeInfoProto) GetPort() int32
func (*NodeInfoProto) GetStatus ¶
func (x *NodeInfoProto) GetStatus() string
func (*NodeInfoProto) ProtoMessage ¶
func (*NodeInfoProto) ProtoMessage()
func (*NodeInfoProto) ProtoReflect ¶
func (x *NodeInfoProto) ProtoReflect() protoreflect.Message
func (*NodeInfoProto) Reset ¶
func (x *NodeInfoProto) Reset()
func (*NodeInfoProto) String ¶
func (x *NodeInfoProto) String() string
type NodeServiceClient ¶
type NodeServiceClient interface {
// SendToUser 向本节点的指定用户发送消息(点对点投递)
// [EN] Send message to a specific user on this node
SendToUser(ctx context.Context, in *SendToUserRequest, opts ...grpc.CallOption) (*SendToUserResponse, error)
// CheckUsersOnline 批量检查用户是否在本节点在线(路由探测)
// [EN] Batch check if users are online on this node
CheckUsersOnline(ctx context.Context, in *CheckUsersOnlineRequest, opts ...grpc.CallOption) (*CheckUsersOnlineResponse, error)
// BroadcastGroup 向本节点的群组成员广播消息
// [EN] Broadcast message to group members on this node
BroadcastGroup(ctx context.Context, in *BroadcastGroupRequest, opts ...grpc.CallOption) (*BroadcastGroupResponse, error)
// NotifyObservers 通知本节点的观察者
// [EN] Notify observers on this node
NotifyObservers(ctx context.Context, in *NotifyObserversRequest, opts ...grpc.CallOption) (*NotifyObserversResponse, error)
// KickUser 踢出本节点上的用户
// [EN] Kick user on this node
KickUser(ctx context.Context, in *KickUserRequest, opts ...grpc.CallOption) (*KickUserResponse, error)
// Ping 节点健康检查
// [EN] Node health check
Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error)
// BatchDispatch 跨节点微批合帧投递(多条指令合并为单次 RPC)
// [EN] Micro-batch dispatch of multiple inter-node delivery instructions in a single RPC
BatchDispatch(ctx context.Context, in *BatchDispatchRequest, opts ...grpc.CallOption) (*BatchDispatchResponse, error)
}
NodeServiceClient is the client API for NodeService 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.
NodeService 节点间 gRPC 通信服务(点对点直连,降低 PubSub 广播延迟) [EN] NodeService is the gRPC service for inter-node communication.
func NewNodeServiceClient ¶
func NewNodeServiceClient(cc grpc.ClientConnInterface) NodeServiceClient
type NodeServiceServer ¶
type NodeServiceServer interface {
// SendToUser 向本节点的指定用户发送消息(点对点投递)
// [EN] Send message to a specific user on this node
SendToUser(context.Context, *SendToUserRequest) (*SendToUserResponse, error)
// CheckUsersOnline 批量检查用户是否在本节点在线(路由探测)
// [EN] Batch check if users are online on this node
CheckUsersOnline(context.Context, *CheckUsersOnlineRequest) (*CheckUsersOnlineResponse, error)
// BroadcastGroup 向本节点的群组成员广播消息
// [EN] Broadcast message to group members on this node
BroadcastGroup(context.Context, *BroadcastGroupRequest) (*BroadcastGroupResponse, error)
// NotifyObservers 通知本节点的观察者
// [EN] Notify observers on this node
NotifyObservers(context.Context, *NotifyObserversRequest) (*NotifyObserversResponse, error)
// KickUser 踢出本节点上的用户
// [EN] Kick user on this node
KickUser(context.Context, *KickUserRequest) (*KickUserResponse, error)
// Ping 节点健康检查
// [EN] Node health check
Ping(context.Context, *PingRequest) (*PingResponse, error)
// BatchDispatch 跨节点微批合帧投递(多条指令合并为单次 RPC)
// [EN] Micro-batch dispatch of multiple inter-node delivery instructions in a single RPC
BatchDispatch(context.Context, *BatchDispatchRequest) (*BatchDispatchResponse, error)
// contains filtered or unexported methods
}
NodeServiceServer is the server API for NodeService service. All implementations must embed UnimplementedNodeServiceServer for forward compatibility.
NodeService 节点间 gRPC 通信服务(点对点直连,降低 PubSub 广播延迟) [EN] NodeService is the gRPC service for inter-node communication.
type NotifyObserversRequest ¶
type NotifyObserversRequest struct {
MessageData []byte `protobuf:"bytes,1,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` // 序列化后的 HubMessageProto | [EN] Serialized HubMessageProto
// contains filtered or unexported fields
}
NotifyObserversRequest 观察者通知请求 路由元数据(namespace, group_ids)通过 gRPC metadata 传递,参见文件头注释 [EN] Observer notification request. Routing metadata via gRPC metadata headers, see file header.
func (*NotifyObserversRequest) Descriptor
deprecated
func (*NotifyObserversRequest) Descriptor() ([]byte, []int)
Deprecated: Use NotifyObserversRequest.ProtoReflect.Descriptor instead.
func (*NotifyObserversRequest) GetMessageData ¶
func (x *NotifyObserversRequest) GetMessageData() []byte
func (*NotifyObserversRequest) ProtoMessage ¶
func (*NotifyObserversRequest) ProtoMessage()
func (*NotifyObserversRequest) ProtoReflect ¶
func (x *NotifyObserversRequest) ProtoReflect() protoreflect.Message
func (*NotifyObserversRequest) Reset ¶
func (x *NotifyObserversRequest) Reset()
func (*NotifyObserversRequest) String ¶
func (x *NotifyObserversRequest) String() string
type NotifyObserversResponse ¶
type NotifyObserversResponse struct {
Notified int32 `protobuf:"varint,1,opt,name=notified,proto3" json:"notified,omitempty"` // 本节点通知数量 | [EN] Notified count on this node
// contains filtered or unexported fields
}
NotifyObserversResponse 观察者通知响应 [EN] Observer notification response
func (*NotifyObserversResponse) Descriptor
deprecated
func (*NotifyObserversResponse) Descriptor() ([]byte, []int)
Deprecated: Use NotifyObserversResponse.ProtoReflect.Descriptor instead.
func (*NotifyObserversResponse) GetNotified ¶
func (x *NotifyObserversResponse) GetNotified() int32
func (*NotifyObserversResponse) ProtoMessage ¶
func (*NotifyObserversResponse) ProtoMessage()
func (*NotifyObserversResponse) ProtoReflect ¶
func (x *NotifyObserversResponse) ProtoReflect() protoreflect.Message
func (*NotifyObserversResponse) Reset ¶
func (x *NotifyObserversResponse) Reset()
func (*NotifyObserversResponse) String ¶
func (x *NotifyObserversResponse) String() string
type PingRequest ¶
type PingRequest struct {
NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // 发起方节点ID | [EN] Source node ID
// contains filtered or unexported fields
}
PingRequest 健康检查请求 [EN] Ping request
func (*PingRequest) Descriptor
deprecated
func (*PingRequest) Descriptor() ([]byte, []int)
Deprecated: Use PingRequest.ProtoReflect.Descriptor instead.
func (*PingRequest) GetNodeId ¶
func (x *PingRequest) GetNodeId() string
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) ProtoReflect ¶
func (x *PingRequest) ProtoReflect() protoreflect.Message
func (*PingRequest) Reset ¶
func (x *PingRequest) Reset()
func (*PingRequest) String ¶
func (x *PingRequest) String() string
type PingResponse ¶
type PingResponse struct {
NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` // 响应方节点ID | [EN] Responder node ID
ActiveConnections int64 `protobuf:"varint,2,opt,name=active_connections,json=activeConnections,proto3" json:"active_connections,omitempty"` // 活跃连接数 | [EN] Active connection count
Healthy bool `protobuf:"varint,3,opt,name=healthy,proto3" json:"healthy,omitempty"` // 节点是否健康 | [EN] Whether node is healthy
// contains filtered or unexported fields
}
PingResponse 健康检查响应 [EN] Ping response
func (*PingResponse) Descriptor
deprecated
func (*PingResponse) Descriptor() ([]byte, []int)
Deprecated: Use PingResponse.ProtoReflect.Descriptor instead.
func (*PingResponse) GetActiveConnections ¶
func (x *PingResponse) GetActiveConnections() int64
func (*PingResponse) GetHealthy ¶
func (x *PingResponse) GetHealthy() bool
func (*PingResponse) GetNodeId ¶
func (x *PingResponse) GetNodeId() string
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) ProtoReflect ¶
func (x *PingResponse) ProtoReflect() protoreflect.Message
func (*PingResponse) Reset ¶
func (x *PingResponse) Reset()
func (*PingResponse) String ¶
func (x *PingResponse) String() string
type SendToUserRequest ¶
type SendToUserRequest struct {
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 目标用户ID | [EN] Target user ID
MessageData []byte `protobuf:"bytes,2,opt,name=message_data,json=messageData,proto3" json:"message_data,omitempty"` // 序列化后的 HubMessageProto | [EN] Serialized HubMessageProto
// contains filtered or unexported fields
}
SendToUserRequest 发送消息请求 [EN] Send message request
func (*SendToUserRequest) Descriptor
deprecated
func (*SendToUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendToUserRequest.ProtoReflect.Descriptor instead.
func (*SendToUserRequest) GetMessageData ¶
func (x *SendToUserRequest) GetMessageData() []byte
func (*SendToUserRequest) GetUserId ¶
func (x *SendToUserRequest) GetUserId() string
func (*SendToUserRequest) ProtoMessage ¶
func (*SendToUserRequest) ProtoMessage()
func (*SendToUserRequest) ProtoReflect ¶
func (x *SendToUserRequest) ProtoReflect() protoreflect.Message
func (*SendToUserRequest) Reset ¶
func (x *SendToUserRequest) Reset()
func (*SendToUserRequest) String ¶
func (x *SendToUserRequest) String() string
type SendToUserResponse ¶
type SendToUserResponse struct {
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // 是否投递成功 | [EN] Whether delivery succeeded
Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // 失败原因(成功时为空) | [EN] Failure reason (empty on success)
UserOnline bool `protobuf:"varint,3,opt,name=user_online,json=userOnline,proto3" json:"user_online,omitempty"` // 用户是否在本节点在线 | [EN] Whether user is online on this node
// contains filtered or unexported fields
}
SendToUserResponse 发送消息响应 [EN] Send message response
func (*SendToUserResponse) Descriptor
deprecated
func (*SendToUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendToUserResponse.ProtoReflect.Descriptor instead.
func (*SendToUserResponse) GetError ¶
func (x *SendToUserResponse) GetError() string
func (*SendToUserResponse) GetSuccess ¶
func (x *SendToUserResponse) GetSuccess() bool
func (*SendToUserResponse) GetUserOnline ¶
func (x *SendToUserResponse) GetUserOnline() bool
func (*SendToUserResponse) ProtoMessage ¶
func (*SendToUserResponse) ProtoMessage()
func (*SendToUserResponse) ProtoReflect ¶
func (x *SendToUserResponse) ProtoReflect() protoreflect.Message
func (*SendToUserResponse) Reset ¶
func (x *SendToUserResponse) Reset()
func (*SendToUserResponse) String ¶
func (x *SendToUserResponse) String() string
type UnimplementedNodeServiceServer ¶
type UnimplementedNodeServiceServer struct{}
UnimplementedNodeServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedNodeServiceServer) BatchDispatch ¶
func (UnimplementedNodeServiceServer) BatchDispatch(context.Context, *BatchDispatchRequest) (*BatchDispatchResponse, error)
func (UnimplementedNodeServiceServer) BroadcastGroup ¶
func (UnimplementedNodeServiceServer) BroadcastGroup(context.Context, *BroadcastGroupRequest) (*BroadcastGroupResponse, error)
func (UnimplementedNodeServiceServer) CheckUsersOnline ¶
func (UnimplementedNodeServiceServer) CheckUsersOnline(context.Context, *CheckUsersOnlineRequest) (*CheckUsersOnlineResponse, error)
func (UnimplementedNodeServiceServer) KickUser ¶
func (UnimplementedNodeServiceServer) KickUser(context.Context, *KickUserRequest) (*KickUserResponse, error)
func (UnimplementedNodeServiceServer) NotifyObservers ¶
func (UnimplementedNodeServiceServer) NotifyObservers(context.Context, *NotifyObserversRequest) (*NotifyObserversResponse, error)
func (UnimplementedNodeServiceServer) Ping ¶
func (UnimplementedNodeServiceServer) Ping(context.Context, *PingRequest) (*PingResponse, error)
func (UnimplementedNodeServiceServer) SendToUser ¶
func (UnimplementedNodeServiceServer) SendToUser(context.Context, *SendToUserRequest) (*SendToUserResponse, error)
type UnsafeNodeServiceServer ¶
type UnsafeNodeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeNodeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeServiceServer will result in compilation errors.