Documentation
¶
Overview ¶
Package actor @Title title @Description desc @Author yr 2025/4/10 @Update yr 2025/4/10
Package actor @Title 请填写文件名称(需要改) @Description 请填写文件描述(需要改) @Author yr 2024/9/4 下午5:53 @Update yr 2024/9/4 下午5:53
Index ¶
- Constants
- Variables
- func CreateServiceUid(serverId int32, serviceName, serviceId string) string
- func IsRetired(pid *PID) bool
- func RegisterGrpcListenerServer(s grpc.ServiceRegistrar, srv GrpcListenerServer)
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetData() *EventData
- func (x *Event) GetEventType() int32
- func (e *Event) GetKey() string
- func (e *Event) GetPriority() int32
- func (x *Event) GetServerId() int32
- func (x *Event) GetTraceId() string
- func (e *Event) GetType() int32
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (e *Event) Release()
- func (x *Event) Reset()
- func (x *Event) String() string
- type EventData
- type GrpcListenerClient
- type GrpcListenerServer
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetCompressType() int32
- func (x *Message) GetErr() string
- func (x *Message) GetMessageHeader() map[string]string
- func (x *Message) GetMethod() string
- func (x *Message) GetNeedResp() bool
- func (x *Message) GetReceiverPid() *PID
- func (x *Message) GetReply() bool
- func (x *Message) GetReqId() uint64
- func (x *Message) GetRequest() []byte
- func (x *Message) GetResponse() []byte
- func (x *Message) GetSenderPid() *PID
- func (x *Message) GetTypeId() int32
- func (x *Message) GetTypeName() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type PID
- func (*PID) Descriptor() ([]byte, []int)deprecated
- func (x *PID) GetAddress() string
- func (x *PID) GetName() string
- func (x *PID) GetNodeUid() string
- func (x *PID) GetRpcType() string
- func (x *PID) GetServerId() int32
- func (x *PID) GetServiceType() string
- func (x *PID) GetServiceUid() string
- func (x *PID) GetState() int32
- func (x *PID) GetVersion() int64
- func (*PID) ProtoMessage()
- func (x *PID) ProtoReflect() protoreflect.Message
- func (x *PID) Reset()
- func (x *PID) String() string
- type RpcCallResponse
- type UnimplementedGrpcListenerServer
- type UnsafeGrpcListenerServer
Constants ¶
const (
GrpcListener_RPCCall_FullMethodName = "/actor.GrpcListener/RPCCall"
)
Variables ¶
var File_actor_actor_proto protoreflect.FileDescriptor
var GrpcListener_ServiceDesc = grpc.ServiceDesc{ ServiceName: "actor.GrpcListener", HandlerType: (*GrpcListenerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RPCCall", Handler: _GrpcListener_RPCCall_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "internal/actor.proto", }
GrpcListener_ServiceDesc is the grpc.ServiceDesc for GrpcListener service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func CreateServiceUid ¶
func RegisterGrpcListenerServer ¶
func RegisterGrpcListenerServer(s grpc.ServiceRegistrar, srv GrpcListenerServer)
Types ¶
type Event ¶ added in v1.1.0
type Event struct { EventType int32 `protobuf:"varint,1,opt,name=EventType,proto3" json:"EventType,omitempty"` // 事件类型 Data *EventData `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"` // 事件数据 ServerId int32 `protobuf:"varint,3,opt,name=ServerId,proto3" json:"ServerId,omitempty"` // 服务器ID TraceId string `protobuf:"bytes,4,opt,name=TraceId,proto3" json:"TraceId,omitempty"` // 链路追踪ID // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
added in
v1.1.0
func (*Event) GetEventType ¶ added in v1.1.0
func (*Event) GetPriority ¶ added in v1.1.0
func (*Event) GetServerId ¶ added in v1.1.0
func (*Event) GetTraceId ¶ added in v1.1.0
func (*Event) ProtoMessage ¶ added in v1.1.0
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶ added in v1.1.0
func (x *Event) ProtoReflect() protoreflect.Message
type EventData ¶ added in v1.1.0
type EventData struct { Header map[string]string `` /* 153-byte string literal not displayed */ RawData []byte `protobuf:"bytes,2,opt,name=RawData,proto3" json:"RawData,omitempty"` // contains filtered or unexported fields }
func (*EventData) Descriptor
deprecated
added in
v1.1.0
func (*EventData) GetRawData ¶ added in v1.1.0
func (*EventData) ProtoMessage ¶ added in v1.1.0
func (*EventData) ProtoMessage()
func (*EventData) ProtoReflect ¶ added in v1.1.0
func (x *EventData) ProtoReflect() protoreflect.Message
type GrpcListenerClient ¶
type GrpcListenerClient interface {
RPCCall(ctx context.Context, in *Message, opts ...grpc.CallOption) (*RpcCallResponse, error)
}
GrpcListenerClient is the client API for GrpcListener 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 NewGrpcListenerClient ¶
func NewGrpcListenerClient(cc grpc.ClientConnInterface) GrpcListenerClient
type GrpcListenerServer ¶
type GrpcListenerServer interface { RPCCall(context.Context, *Message) (*RpcCallResponse, error) // contains filtered or unexported methods }
GrpcListenerServer is the server API for GrpcListener service. All implementations must embed UnimplementedGrpcListenerServer for forward compatibility.
type Message ¶
type Message struct { TypeId int32 `protobuf:"varint,1,opt,name=TypeId,proto3" json:"TypeId,omitempty"` // 消息类型ID TypeName string `protobuf:"bytes,2,opt,name=TypeName,proto3" json:"TypeName,omitempty"` // 消息类型名称 SenderPid *PID `protobuf:"bytes,3,opt,name=SenderPid,proto3" json:"SenderPid,omitempty"` // 发送者 ReceiverPid *PID `protobuf:"bytes,4,opt,name=ReceiverPid,proto3" json:"ReceiverPid,omitempty"` // 接收者 Method string `protobuf:"bytes,5,opt,name=Method,proto3" json:"Method,omitempty"` // 调用方法 Request []byte `protobuf:"bytes,6,opt,name=Request,proto3" json:"Request,omitempty"` // 方法参数 Response []byte `protobuf:"bytes,7,opt,name=Response,proto3" json:"Response,omitempty"` // 方法返回值 Err string `protobuf:"bytes,8,opt,name=Err,proto3" json:"Err,omitempty"` // 错误信息 MessageHeader map[string]string `` // 消息头(额外信息) /* 167-byte string literal not displayed */ Reply bool `protobuf:"varint,10,opt,name=Reply,proto3" json:"Reply,omitempty"` // 是否是回复 ReqId uint64 `protobuf:"varint,11,opt,name=ReqId,proto3" json:"ReqId,omitempty"` // 请求ID NeedResp bool `protobuf:"varint,12,opt,name=NeedResp,proto3" json:"NeedResp,omitempty"` // 是否需要回复 CompressType int32 `protobuf:"varint,13,opt,name=CompressType,proto3" json:"CompressType,omitempty"` // 压缩类型(0无压缩) // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetCompressType ¶
func (*Message) GetMessageHeader ¶
func (*Message) GetNeedResp ¶
func (*Message) GetReceiverPid ¶
func (*Message) GetRequest ¶
func (*Message) GetResponse ¶
func (*Message) GetSenderPid ¶
func (*Message) GetTypeName ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type PID ¶
type PID struct { Address string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"` // 服务地址 Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` // 服务名称 ServiceType string `protobuf:"bytes,3,opt,name=ServiceType,proto3" json:"ServiceType,omitempty"` // 服务类型 ServiceUid string `protobuf:"bytes,4,opt,name=ServiceUid,proto3" json:"ServiceUid,omitempty"` // 服务实例在集群的唯一标识(serverId:serviceName@Uid) State int32 `protobuf:"varint,5,opt,name=State,proto3" json:"State,omitempty"` // 服务状态(0: 正常, 1: 退休) ServerId int32 `protobuf:"varint,6,opt,name=ServerId,proto3" json:"ServerId,omitempty"` // 服务ID Version int64 `protobuf:"varint,7,opt,name=Version,proto3" json:"Version,omitempty"` // 服务版本号 RpcType string `protobuf:"bytes,8,opt,name=RpcType,proto3" json:"RpcType,omitempty"` // rpc类型(默认使用rpcx) NodeUid string `protobuf:"bytes,9,opt,name=NodeUid,proto3" json:"NodeUid,omitempty"` // 节点唯一标识(这个主要是用来区分本地服务用的) // contains filtered or unexported fields }
func (*PID) Descriptor
deprecated
func (*PID) GetAddress ¶
func (*PID) GetNodeUid ¶
func (*PID) GetRpcType ¶
func (*PID) GetServerId ¶
func (*PID) GetServiceType ¶
func (*PID) GetServiceUid ¶
func (*PID) GetVersion ¶
func (*PID) ProtoMessage ¶
func (*PID) ProtoMessage()
func (*PID) ProtoReflect ¶
func (x *PID) ProtoReflect() protoreflect.Message
type RpcCallResponse ¶
type RpcCallResponse struct {
// contains filtered or unexported fields
}
func (*RpcCallResponse) Descriptor
deprecated
func (*RpcCallResponse) Descriptor() ([]byte, []int)
Deprecated: Use RpcCallResponse.ProtoReflect.Descriptor instead.
func (*RpcCallResponse) ProtoMessage ¶
func (*RpcCallResponse) ProtoMessage()
func (*RpcCallResponse) ProtoReflect ¶
func (x *RpcCallResponse) ProtoReflect() protoreflect.Message
func (*RpcCallResponse) Reset ¶
func (x *RpcCallResponse) Reset()
func (*RpcCallResponse) String ¶
func (x *RpcCallResponse) String() string
type UnimplementedGrpcListenerServer ¶
type UnimplementedGrpcListenerServer struct{}
UnimplementedGrpcListenerServer 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 (UnimplementedGrpcListenerServer) RPCCall ¶
func (UnimplementedGrpcListenerServer) RPCCall(context.Context, *Message) (*RpcCallResponse, error)
type UnsafeGrpcListenerServer ¶
type UnsafeGrpcListenerServer interface {
// contains filtered or unexported methods
}
UnsafeGrpcListenerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GrpcListenerServer will result in compilation errors.