actor

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package actor @Title 请填写文件名称(需要改) @Description 请填写文件描述(需要改) @Author yr 2024/9/4 下午5:53 @Update yr 2024/9/4 下午5:53

Index

Constants

This section is empty.

Variables

View Source
var File_internal_actor_proto protoreflect.FileDescriptor

Functions

func CreateServiceUid

func CreateServiceUid(serverId int32, serviceName, serviceId string) string

func IsRetired

func IsRetired(pid *PID) bool

Types

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 added in v1.0.2

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 added in v1.0.2

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 added in v1.0.2

func (x *PID) GetNodeUid() string

func (*PID) GetRpcType added in v1.0.2

func (x *PID) GetRpcType() string

func (*PID) GetServerId

func (x *PID) GetServerId() int32

func (*PID) GetServiceType added in v1.0.2

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

Jump to

Keyboard shortcuts

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