Documentation ¶
Index ¶
- Variables
- func PackContentToPackage(bufContent []byte) []byte
- func PackPackage(id interface{}, data proto.Message) []byte
- func PackProtoToPackage(message proto.Message, cmd int32) []byte
- func SendToClient(conn net2.Conn, message *PackMsg, cmdForLog int32) bool
- func SendToSingleServer(conn net2.Conn, message proto.Message) bool
- func SendToSingleServerNoLen(conn net2.Conn, message *AgentData) bool
- type AgentData
- func (*AgentData) Descriptor() ([]byte, []int)deprecated
- func (x *AgentData) GetCliId() uint64
- func (x *AgentData) GetClose() bool
- func (x *AgentData) GetData() []byte
- func (x *AgentData) GetId() uint32
- func (x *AgentData) GetStatus() Status
- func (x *AgentData) GetWeight() int32
- func (x *AgentData) GetWs() string
- func (*AgentData) ProtoMessage()
- func (x *AgentData) ProtoReflect() protoreflect.Message
- func (x *AgentData) Reset()
- func (x *AgentData) String() string
- type Context
- func (c *Context) Abort()
- func (c *Context) BackData(data proto.Message) bool
- func (c *Context) BackDataBuf(data []byte) bool
- func (c *Context) BackRet(ret int32) bool
- func (c *Context) BackRetTip(ret int32, tip string) bool
- func (c *Context) BackWait() bool
- func (c *Context) BackWait0() bool
- func (c *Context) Next() bool
- func (c *Context) Reset(msg *PackMsg, handlers HandlersChan) error
- func (c *Context) ResetNil()
- func (c *Context) SendBuff(bufPackage []byte) bool
- func (c *Context) SendData(cmd interface{}, data proto.Message) bool
- func (c *Context) SendPackMsg(head *PackMsg) bool
- func (c *Context) SendRet(cmd interface{}, ret int32) bool
- func (c *Context) SendTip(cmd interface{}, ret int32, tip string) bool
- type Handler
- type HandlersChan
- type PackMsg
- func (*PackMsg) Descriptor() ([]byte, []int)deprecated
- func (x *PackMsg) GetBinary() []byte
- func (x *PackMsg) GetCmd() int32
- func (x *PackMsg) GetRet() int32
- func (x *PackMsg) GetSeq() int32
- func (x *PackMsg) GetTip() string
- func (*PackMsg) ProtoMessage()
- func (x *PackMsg) ProtoReflect() protoreflect.Message
- func (x *PackMsg) Reset()
- func (x *PackMsg) String() string
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Status_name = map[int32]string{ 0: "Init", 2: "Close", 3: "Live", } Status_value = map[string]int32{ "Init": 0, "Close": 2, "Live": 3, } )
Enum value maps for Status.
View Source
var File_packmsg_proto protoreflect.FileDescriptor
Functions ¶
func PackContentToPackage ¶
func PackPackage ¶
Types ¶
type AgentData ¶
type AgentData struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` //服务ID // uint32 sid = 2;//连接的索引 CliId uint64 `protobuf:"varint,3,opt,name=cliId,proto3" json:"cliId,omitempty"` //客户端ID Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=cmd.Status" json:"status,omitempty"` // string ip = 5;//仅连接的时候传值 Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` Close bool `protobuf:"varint,7,opt,name=close,proto3" json:"close,omitempty"` //是否关闭连接=>来自服务器 Ws string `protobuf:"bytes,8,opt,name=ws,proto3" json:"ws,omitempty"` //接入地址 Weight int32 `protobuf:"varint,9,opt,name=weight,proto3" json:"weight,omitempty"` //权重 // contains filtered or unexported fields }
func (*AgentData) Descriptor
deprecated
func (*AgentData) ProtoMessage ¶
func (*AgentData) ProtoMessage()
func (*AgentData) ProtoReflect ¶
func (x *AgentData) ProtoReflect() protoreflect.Message
type HandlersChan ¶
type HandlersChan []Handler
type PackMsg ¶
type PackMsg struct { Cmd int32 `protobuf:"varint,1,opt,name=cmd,proto3" json:"cmd,omitempty"` //Cmd Seq int32 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"` //序列号 Ret int32 `protobuf:"varint,3,opt,name=ret,proto3" json:"ret,omitempty"` //返回值 Binary []byte `protobuf:"bytes,4,opt,name=binary,proto3" json:"binary,omitempty"` //包内容 Tip string `protobuf:"bytes,5,opt,name=tip,proto3" json:"tip,omitempty"` //服务器传来的提示消息内容 // contains filtered or unexported fields }
func (*PackMsg) Descriptor
deprecated
func (*PackMsg) ProtoMessage ¶
func (*PackMsg) ProtoMessage()
func (*PackMsg) ProtoReflect ¶
func (x *PackMsg) ProtoReflect() protoreflect.Message
type Status ¶
type Status int32
网关数据
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
Click to show internal directories.
Click to hide internal directories.