actor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 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_actor_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"` // 消息类型名称
	Sender        *PID              `protobuf:"bytes,3,opt,name=Sender,proto3" json:"Sender,omitempty"`     // 发送者
	Receiver      *PID              `protobuf:"bytes,4,opt,name=Receiver,proto3" json:"Receiver,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) GetReceiver

func (x *Message) GetReceiver() *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) GetSender

func (x *Message) GetSender() *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"`       // 服务地址
	NodeId     int32  `protobuf:"varint,2,opt,name=NodeId,proto3" json:"NodeId,omitempty"`        // 节点id(用来区分本地服务和远程服务)
	NodeType   string `protobuf:"bytes,3,opt,name=NodeType,proto3" json:"NodeType,omitempty"`     // 节点类型
	Uid        string `protobuf:"bytes,4,opt,name=Uid,proto3" json:"Uid,omitempty"`               // 服务唯一标识(在本地同名字的服务中唯一)
	Name       string `protobuf:"bytes,5,opt,name=Name,proto3" json:"Name,omitempty"`             // 服务名称
	ServiceUid string `protobuf:"bytes,6,opt,name=ServiceUid,proto3" json:"ServiceUid,omitempty"` // 服务实例在集群的唯一标识(serverId:serviceName@Uid)
	State      int32  `protobuf:"varint,7,opt,name=State,proto3" json:"State,omitempty"`          // 服务状态(0: 正常, 1: 退休)
	ServerId   int32  `protobuf:"varint,8,opt,name=ServerId,proto3" json:"ServerId,omitempty"`    // 服务ID
	Version    int64  `protobuf:"varint,9,opt,name=Version,proto3" json:"Version,omitempty"`      // 服务版本号
	// contains filtered or unexported fields
}

func NewPID

func NewPID(nodeId int32, nodeType, address string, serverId int32, serviceID, serviceName string, version int64) *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) GetNodeId

func (x *PID) GetNodeId() int32

func (*PID) GetNodeType

func (x *PID) GetNodeType() string

func (*PID) GetServerId

func (x *PID) GetServerId() int32

func (*PID) GetServiceUid

func (x *PID) GetServiceUid() string

func (*PID) GetState

func (x *PID) GetState() int32

func (*PID) GetUid

func (x *PID) GetUid() string

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