actor

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

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

View Source
const (
	GrpcListener_RPCCall_FullMethodName = "/actor.GrpcListener/RPCCall"
)

Variables

View Source
var File_actor_actor_proto protoreflect.FileDescriptor
View Source
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 CreateServiceUid(serverId int32, serviceName, serviceId string) string

func IsRetired

func IsRetired(pid *PID) bool

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

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetData added in v1.1.0

func (x *Event) GetData() *EventData

func (*Event) GetEventType added in v1.1.0

func (x *Event) GetEventType() int32

func (*Event) GetKey added in v1.1.0

func (e *Event) GetKey() string

func (*Event) GetPriority added in v1.1.0

func (e *Event) GetPriority() int32

func (*Event) GetServerId added in v1.1.0

func (x *Event) GetServerId() int32

func (*Event) GetTraceId added in v1.1.0

func (x *Event) GetTraceId() string

func (*Event) GetType added in v1.1.0

func (e *Event) GetType() int32

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

func (*Event) Release added in v1.1.0

func (e *Event) Release()

func (*Event) Reset added in v1.1.0

func (x *Event) Reset()

func (*Event) String added in v1.1.0

func (x *Event) String() string

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

Deprecated: Use EventData.ProtoReflect.Descriptor instead.

func (*EventData) GetHeader added in v1.1.0

func (x *EventData) GetHeader() map[string]string

func (*EventData) GetRawData added in v1.1.0

func (x *EventData) GetRawData() []byte

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

func (*EventData) Reset added in v1.1.0

func (x *EventData) Reset()

func (*EventData) String added in v1.1.0

func (x *EventData) String() string

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.

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCompressType

func (x *Message) GetCompressType() int32

func (*Message) GetErr

func (x *Message) GetErr() string

func (*Message) GetMessageHeader

func (x *Message) GetMessageHeader() map[string]string

func (*Message) GetMethod

func (x *Message) GetMethod() string

func (*Message) GetNeedResp

func (x *Message) GetNeedResp() bool

func (*Message) GetReceiverPid

func (x *Message) GetReceiverPid() *PID

func (*Message) GetReply

func (x *Message) GetReply() bool

func (*Message) GetReqId

func (x *Message) GetReqId() uint64

func (*Message) GetRequest

func (x *Message) GetRequest() []byte

func (*Message) GetResponse

func (x *Message) GetResponse() []byte

func (*Message) GetSenderPid

func (x *Message) GetSenderPid() *PID

func (*Message) GetTypeId

func (x *Message) GetTypeId() int32

func (*Message) GetTypeName

func (x *Message) GetTypeName() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

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 NewPID

func NewPID(address, nodeUid string, serverId int32, serviceID, serviceType, serviceName string, version int64, rpcType string) *PID

func (*PID) Descriptor deprecated

func (*PID) Descriptor() ([]byte, []int)

Deprecated: Use PID.ProtoReflect.Descriptor instead.

func (*PID) GetAddress

func (x *PID) GetAddress() string

func (*PID) GetName

func (x *PID) GetName() string

func (*PID) GetNodeUid

func (x *PID) GetNodeUid() string

func (*PID) GetRpcType

func (x *PID) GetRpcType() string

func (*PID) GetServerId

func (x *PID) GetServerId() int32

func (*PID) GetServiceType

func (x *PID) GetServiceType() string

func (*PID) GetServiceUid

func (x *PID) GetServiceUid() string

func (*PID) GetState

func (x *PID) GetState() int32

func (*PID) GetVersion

func (x *PID) GetVersion() int64

func (*PID) ProtoMessage

func (*PID) ProtoMessage()

func (*PID) ProtoReflect

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

func (*PID) Reset

func (x *PID) Reset()

func (*PID) String

func (x *PID) String() string

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

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.

Directories

Path Synopsis
Package mailbox @Title 邮箱 @Description 负责调度消息 @Author yr 2025/2/8 @Update yr 2025/2/8
Package mailbox @Title 邮箱 @Description 负责调度消息 @Author yr 2025/2/8 @Update yr 2025/2/8

Jump to

Keyboard shortcuts

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