pkt

package
Version: v0.0.0-...-0c79dac Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodePing = uint16(1)
	CodePong = uint16(2)
)

basic pkt code

Variables

View Source
var (
	Status_name = map[int32]string{
		0:   "Success",
		100: "NoDestination",
		101: "InvalidPacketBody",
		103: "InvalidCommand",
		105: "Unauthorized",
		300: "SystemException",
		301: "NotImplemented",
		404: "SessionNotFound",
	}
	Status_value = map[string]int32{
		"Success":           0,
		"NoDestination":     100,
		"InvalidPacketBody": 101,
		"InvalidCommand":    103,
		"Unauthorized":      105,
		"SystemException":   300,
		"NotImplemented":    301,
		"SessionNotFound":   404,
	}
)

Enum value maps for Status.

View Source
var (
	MetaType_name = map[int32]string{
		0: "int",
		1: "string",
		2: "float",
	}
	MetaType_value = map[string]int32{
		"int":    0,
		"string": 1,
		"float":  2,
	}
)

Enum value maps for MetaType.

View Source
var (
	ContentType_name = map[int32]string{
		0: "Protobuf",
		1: "Json",
	}
	ContentType_value = map[string]int32{
		"Protobuf": 0,
		"Json":     1,
	}
)

Enum value maps for ContentType.

View Source
var (
	Flag_name = map[int32]string{
		0: "Request",
		1: "Response",
		2: "Push",
	}
	Flag_value = map[string]int32{
		"Request":  0,
		"Response": 1,
		"Push":     2,
	}
)

Enum value maps for Flag.

View Source
var File_common_proto protoreflect.FileDescriptor
View Source
var File_protocol_proto protoreflect.FileDescriptor

Functions

func Marshal

func Marshal(p Packet) []byte

func Read

func Read(r io.Reader) (interface{}, error)

Types

type BasicPkt

type BasicPkt struct {
	Code   uint16
	Length uint16
	Body   []byte
}

func MustReadBasicPkt

func MustReadBasicPkt(r io.Reader) (*BasicPkt, error)

func (*BasicPkt) Decode

func (p *BasicPkt) Decode(r io.Reader) error

func (*BasicPkt) Encode

func (p *BasicPkt) Encode(w io.Writer) error

type ContentType

type ContentType int32
const (
	ContentType_Protobuf ContentType = 0
	ContentType_Json     ContentType = 1
)

func (ContentType) Descriptor

func (ContentType) Enum

func (x ContentType) Enum() *ContentType

func (ContentType) EnumDescriptor deprecated

This method has been deprecated.
func (ContentType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ContentType.Descriptor instead.

func (ContentType) Number

func (x ContentType) Number() protoreflect.EnumNumber

func (ContentType) String

func (x ContentType) String() string

func (ContentType) Type

type ErrorResp

type ErrorResp struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ErrorResp) Descriptor deprecated

This method has been deprecated.
func (*ErrorResp) Descriptor() ([]byte, []int)

Deprecated: Use ErrorResp.ProtoReflect.Descriptor instead.

func (*ErrorResp) GetMessage

func (x *ErrorResp) GetMessage() string

func (*ErrorResp) ProtoMessage

func (*ErrorResp) ProtoMessage()

func (*ErrorResp) ProtoReflect

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

func (*ErrorResp) Reset

func (x *ErrorResp) Reset()

func (*ErrorResp) String

func (x *ErrorResp) String() string

type Flag

type Flag int32
const (
	Flag_Request  Flag = 0
	Flag_Response Flag = 1
	Flag_Push     Flag = 2
)

func (Flag) Descriptor

func (Flag) Descriptor() protoreflect.EnumDescriptor

func (Flag) Enum

func (x Flag) Enum() *Flag

func (Flag) EnumDescriptor deprecated

This method has been deprecated.
func (Flag) EnumDescriptor() ([]byte, []int)

Deprecated: Use Flag.Descriptor instead.

func (Flag) Number

func (x Flag) Number() protoreflect.EnumNumber

func (Flag) String

func (x Flag) String() string

func (Flag) Type

func (Flag) Type() protoreflect.EnumType

type GroupCreateNotify

type GroupCreateNotify struct {
	GroupId string   `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Members []string `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupCreateNotify) Descriptor deprecated

This method has been deprecated.
func (*GroupCreateNotify) Descriptor() ([]byte, []int)

Deprecated: Use GroupCreateNotify.ProtoReflect.Descriptor instead.

func (*GroupCreateNotify) GetGroupId

func (x *GroupCreateNotify) GetGroupId() string

func (*GroupCreateNotify) GetMembers

func (x *GroupCreateNotify) GetMembers() []string

func (*GroupCreateNotify) ProtoMessage

func (*GroupCreateNotify) ProtoMessage()

func (*GroupCreateNotify) ProtoReflect

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

func (*GroupCreateNotify) Reset

func (x *GroupCreateNotify) Reset()

func (*GroupCreateNotify) String

func (x *GroupCreateNotify) String() string

type GroupCreateReq

type GroupCreateReq struct {
	Name         string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Avatar       string   `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"`
	Introduction string   `protobuf:"bytes,3,opt,name=introduction,proto3" json:"introduction,omitempty"`
	Owner        string   `protobuf:"bytes,4,opt,name=owner,proto3" json:"owner,omitempty"`
	Members      []string `protobuf:"bytes,5,rep,name=members,proto3" json:"members,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupCreateReq) Descriptor deprecated

This method has been deprecated.
func (*GroupCreateReq) Descriptor() ([]byte, []int)

Deprecated: Use GroupCreateReq.ProtoReflect.Descriptor instead.

func (*GroupCreateReq) GetAvatar

func (x *GroupCreateReq) GetAvatar() string

func (*GroupCreateReq) GetIntroduction

func (x *GroupCreateReq) GetIntroduction() string

func (*GroupCreateReq) GetMembers

func (x *GroupCreateReq) GetMembers() []string

func (*GroupCreateReq) GetName

func (x *GroupCreateReq) GetName() string

func (*GroupCreateReq) GetOwner

func (x *GroupCreateReq) GetOwner() string

func (*GroupCreateReq) ProtoMessage

func (*GroupCreateReq) ProtoMessage()

func (*GroupCreateReq) ProtoReflect

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

func (*GroupCreateReq) Reset

func (x *GroupCreateReq) Reset()

func (*GroupCreateReq) String

func (x *GroupCreateReq) String() string

type GroupCreateResp

type GroupCreateResp struct {
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupCreateResp) Descriptor deprecated

This method has been deprecated.
func (*GroupCreateResp) Descriptor() ([]byte, []int)

Deprecated: Use GroupCreateResp.ProtoReflect.Descriptor instead.

func (*GroupCreateResp) GetGroupId

func (x *GroupCreateResp) GetGroupId() string

func (*GroupCreateResp) ProtoMessage

func (*GroupCreateResp) ProtoMessage()

func (*GroupCreateResp) ProtoReflect

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

func (*GroupCreateResp) Reset

func (x *GroupCreateResp) Reset()

func (*GroupCreateResp) String

func (x *GroupCreateResp) String() string

type GroupGetReq

type GroupGetReq struct {
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupGetReq) Descriptor deprecated

This method has been deprecated.
func (*GroupGetReq) Descriptor() ([]byte, []int)

Deprecated: Use GroupGetReq.ProtoReflect.Descriptor instead.

func (*GroupGetReq) GetGroupId

func (x *GroupGetReq) GetGroupId() string

func (*GroupGetReq) ProtoMessage

func (*GroupGetReq) ProtoMessage()

func (*GroupGetReq) ProtoReflect

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

func (*GroupGetReq) Reset

func (x *GroupGetReq) Reset()

func (*GroupGetReq) String

func (x *GroupGetReq) String() string

type GroupGetResp

type GroupGetResp struct {
	Id           string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name         string    `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Avatar       string    `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"`
	Introduction string    `protobuf:"bytes,4,opt,name=introduction,proto3" json:"introduction,omitempty"`
	Owner        string    `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"`
	Members      []*Member `protobuf:"bytes,6,rep,name=members,proto3" json:"members,omitempty"`
	CreatedAt    int64     `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupGetResp) Descriptor deprecated

This method has been deprecated.
func (*GroupGetResp) Descriptor() ([]byte, []int)

Deprecated: Use GroupGetResp.ProtoReflect.Descriptor instead.

func (*GroupGetResp) GetAvatar

func (x *GroupGetResp) GetAvatar() string

func (*GroupGetResp) GetCreatedAt

func (x *GroupGetResp) GetCreatedAt() int64

func (*GroupGetResp) GetId

func (x *GroupGetResp) GetId() string

func (*GroupGetResp) GetIntroduction

func (x *GroupGetResp) GetIntroduction() string

func (*GroupGetResp) GetMembers

func (x *GroupGetResp) GetMembers() []*Member

func (*GroupGetResp) GetName

func (x *GroupGetResp) GetName() string

func (*GroupGetResp) GetOwner

func (x *GroupGetResp) GetOwner() string

func (*GroupGetResp) ProtoMessage

func (*GroupGetResp) ProtoMessage()

func (*GroupGetResp) ProtoReflect

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

func (*GroupGetResp) Reset

func (x *GroupGetResp) Reset()

func (*GroupGetResp) String

func (x *GroupGetResp) String() string

type GroupJoinNotify

type GroupJoinNotify struct {
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupJoinNotify) Descriptor deprecated

This method has been deprecated.
func (*GroupJoinNotify) Descriptor() ([]byte, []int)

Deprecated: Use GroupJoinNotify.ProtoReflect.Descriptor instead.

func (*GroupJoinNotify) GetAccount

func (x *GroupJoinNotify) GetAccount() string

func (*GroupJoinNotify) GetGroupId

func (x *GroupJoinNotify) GetGroupId() string

func (*GroupJoinNotify) ProtoMessage

func (*GroupJoinNotify) ProtoMessage()

func (*GroupJoinNotify) ProtoReflect

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

func (*GroupJoinNotify) Reset

func (x *GroupJoinNotify) Reset()

func (*GroupJoinNotify) String

func (x *GroupJoinNotify) String() string

type GroupJoinReq

type GroupJoinReq struct {
	Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupJoinReq) Descriptor deprecated

This method has been deprecated.
func (*GroupJoinReq) Descriptor() ([]byte, []int)

Deprecated: Use GroupJoinReq.ProtoReflect.Descriptor instead.

func (*GroupJoinReq) GetAccount

func (x *GroupJoinReq) GetAccount() string

func (*GroupJoinReq) GetGroupId

func (x *GroupJoinReq) GetGroupId() string

func (*GroupJoinReq) ProtoMessage

func (*GroupJoinReq) ProtoMessage()

func (*GroupJoinReq) ProtoReflect

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

func (*GroupJoinReq) Reset

func (x *GroupJoinReq) Reset()

func (*GroupJoinReq) String

func (x *GroupJoinReq) String() string

type GroupQuitNotify

type GroupQuitNotify struct {
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupQuitNotify) Descriptor deprecated

This method has been deprecated.
func (*GroupQuitNotify) Descriptor() ([]byte, []int)

Deprecated: Use GroupQuitNotify.ProtoReflect.Descriptor instead.

func (*GroupQuitNotify) GetAccount

func (x *GroupQuitNotify) GetAccount() string

func (*GroupQuitNotify) GetGroupId

func (x *GroupQuitNotify) GetGroupId() string

func (*GroupQuitNotify) ProtoMessage

func (*GroupQuitNotify) ProtoMessage()

func (*GroupQuitNotify) ProtoReflect

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

func (*GroupQuitNotify) Reset

func (x *GroupQuitNotify) Reset()

func (*GroupQuitNotify) String

func (x *GroupQuitNotify) String() string

type GroupQuitReq

type GroupQuitReq struct {
	Account string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GroupQuitReq) Descriptor deprecated

This method has been deprecated.
func (*GroupQuitReq) Descriptor() ([]byte, []int)

Deprecated: Use GroupQuitReq.ProtoReflect.Descriptor instead.

func (*GroupQuitReq) GetAccount

func (x *GroupQuitReq) GetAccount() string

func (*GroupQuitReq) GetGroupId

func (x *GroupQuitReq) GetGroupId() string

func (*GroupQuitReq) ProtoMessage

func (*GroupQuitReq) ProtoMessage()

func (*GroupQuitReq) ProtoReflect

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

func (*GroupQuitReq) Reset

func (x *GroupQuitReq) Reset()

func (*GroupQuitReq) String

func (x *GroupQuitReq) String() string
type Header struct {
	Command string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	// sender channel id
	ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"`
	Sequence  uint32 `protobuf:"varint,3,opt,name=sequence,proto3" json:"sequence,omitempty"`
	Flag      Flag   `protobuf:"varint,4,opt,name=flag,proto3,enum=pkt.Flag" json:"flag,omitempty"`
	Status    Status `protobuf:"varint,5,opt,name=status,proto3,enum=pkt.Status" json:"status,omitempty"`
	// destination is defined as a account,group or room
	Dest string  `protobuf:"bytes,6,opt,name=dest,proto3" json:"dest,omitempty"`
	Meta []*Meta `protobuf:"bytes,7,rep,name=meta,proto3" json:"meta,omitempty"`
	// contains filtered or unexported fields
}

func (*Header) Descriptor deprecated

This method has been deprecated.
func (*Header) Descriptor() ([]byte, []int)

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetChannelId

func (x *Header) GetChannelId() string

func (*Header) GetCommand

func (x *Header) GetCommand() string

func (*Header) GetDest

func (x *Header) GetDest() string

func (*Header) GetFlag

func (x *Header) GetFlag() Flag

func (*Header) GetMeta

func (x *Header) GetMeta() []*Meta

func (*Header) GetSequence

func (x *Header) GetSequence() uint32

func (*Header) GetStatus

func (x *Header) GetStatus() Status

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

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

func (*Header) Reset

func (x *Header) Reset()

func (*Header) ServiceName

func (h *Header) ServiceName() string

func (*Header) String

func (x *Header) String() string

type HeaderOption

type HeaderOption func(*Header)

HeaderOption HeaderOption

func WithChannel

func WithChannel(channelID string) HeaderOption

WithChannel set channelID

func WithDest

func WithDest(dest string) HeaderOption

WithDest WithDest

func WithSeq

func WithSeq(seq uint32) HeaderOption

WithSeq WithSeq

func WithStatus

func WithStatus(status Status) HeaderOption

WithStatus WithStatus

type InnerHandshakeReq

type InnerHandshakeReq struct {
	ServiceId string `protobuf:"bytes,1,opt,name=ServiceId,proto3" json:"ServiceId,omitempty"`
	// contains filtered or unexported fields
}

func (*InnerHandshakeReq) Descriptor deprecated

This method has been deprecated.
func (*InnerHandshakeReq) Descriptor() ([]byte, []int)

Deprecated: Use InnerHandshakeReq.ProtoReflect.Descriptor instead.

func (*InnerHandshakeReq) GetServiceId

func (x *InnerHandshakeReq) GetServiceId() string

func (*InnerHandshakeReq) ProtoMessage

func (*InnerHandshakeReq) ProtoMessage()

func (*InnerHandshakeReq) ProtoReflect

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

func (*InnerHandshakeReq) Reset

func (x *InnerHandshakeReq) Reset()

func (*InnerHandshakeReq) String

func (x *InnerHandshakeReq) String() string

type InnerHandshakeResponse

type InnerHandshakeResponse struct {
	Code  uint32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
	Error string `protobuf:"bytes,2,opt,name=Error,proto3" json:"Error,omitempty"`
	// contains filtered or unexported fields
}

func (*InnerHandshakeResponse) Descriptor deprecated

This method has been deprecated.
func (*InnerHandshakeResponse) Descriptor() ([]byte, []int)

Deprecated: Use InnerHandshakeResponse.ProtoReflect.Descriptor instead.

func (*InnerHandshakeResponse) GetCode

func (x *InnerHandshakeResponse) GetCode() uint32

func (*InnerHandshakeResponse) GetError

func (x *InnerHandshakeResponse) GetError() string

func (*InnerHandshakeResponse) ProtoMessage

func (*InnerHandshakeResponse) ProtoMessage()

func (*InnerHandshakeResponse) ProtoReflect

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

func (*InnerHandshakeResponse) Reset

func (x *InnerHandshakeResponse) Reset()

func (*InnerHandshakeResponse) String

func (x *InnerHandshakeResponse) String() string

type KickoutNotify

type KickoutNotify struct {
	ChannelId string `protobuf:"bytes,1,opt,name=channelId,proto3" json:"channelId,omitempty"`
	// contains filtered or unexported fields
}

func (*KickoutNotify) Descriptor deprecated

This method has been deprecated.
func (*KickoutNotify) Descriptor() ([]byte, []int)

Deprecated: Use KickoutNotify.ProtoReflect.Descriptor instead.

func (*KickoutNotify) GetChannelId

func (x *KickoutNotify) GetChannelId() string

func (*KickoutNotify) ProtoMessage

func (*KickoutNotify) ProtoMessage()

func (*KickoutNotify) ProtoReflect

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

func (*KickoutNotify) Reset

func (x *KickoutNotify) Reset()

func (*KickoutNotify) String

func (x *KickoutNotify) String() string

type LogicPkt

type LogicPkt struct {
	Header
	Body []byte `json:"body,omitempty"`
}

LogicPkt 定义了网关对外的client消息结构

func MustReadLogicPkt

func MustReadLogicPkt(r io.Reader) (*LogicPkt, error)

func New

func New(command string, options ...HeaderOption) *LogicPkt

New new a empty payload message

func NewFrom

func NewFrom(header *Header) *LogicPkt

NewFrom new packet from a header

func (*LogicPkt) AddMeta

func (p *LogicPkt) AddMeta(m ...*Meta)

AddMeta AddMeta

func (*LogicPkt) AddStringMeta

func (p *LogicPkt) AddStringMeta(key, value string)

AddStringMeta AddStringMeta

func (*LogicPkt) Decode

func (p *LogicPkt) Decode(r io.Reader) error

ReadPkt read bytes to LogicPkt from a reader

func (*LogicPkt) DelMeta

func (p *LogicPkt) DelMeta(key string)

DelMeta DelMeta

func (*LogicPkt) Encode

func (p *LogicPkt) Encode(w io.Writer) error

Encode Encode Header to writer

func (*LogicPkt) GetMeta

func (p *LogicPkt) GetMeta(key string) (interface{}, bool)

GetMeta extra value

func (*LogicPkt) ReadBody

func (p *LogicPkt) ReadBody(val proto.Message) error

ReadBody val must be a pointer

func (*LogicPkt) String

func (p *LogicPkt) String() string

func (*LogicPkt) StringBody

func (p *LogicPkt) StringBody() string

StringBody return string body

func (*LogicPkt) WriteBody

func (p *LogicPkt) WriteBody(val proto.Message) *LogicPkt

WritePb WritePb

type LoginReq

type LoginReq struct {
	Token string   `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Isp   string   `protobuf:"bytes,2,opt,name=isp,proto3" json:"isp,omitempty"`
	Zone  string   `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"` // location code
	Tags  []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginReq) Descriptor deprecated

This method has been deprecated.
func (*LoginReq) Descriptor() ([]byte, []int)

Deprecated: Use LoginReq.ProtoReflect.Descriptor instead.

func (*LoginReq) GetIsp

func (x *LoginReq) GetIsp() string

func (*LoginReq) GetTags

func (x *LoginReq) GetTags() []string

func (*LoginReq) GetToken

func (x *LoginReq) GetToken() string

func (*LoginReq) GetZone

func (x *LoginReq) GetZone() string

func (*LoginReq) ProtoMessage

func (*LoginReq) ProtoMessage()

func (*LoginReq) ProtoReflect

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

func (*LoginReq) Reset

func (x *LoginReq) Reset()

func (*LoginReq) String

func (x *LoginReq) String() string

type LoginResp

type LoginResp struct {
	ChannelId string `protobuf:"bytes,1,opt,name=channelId,proto3" json:"channelId,omitempty"`
	Account   string `protobuf:"bytes,2,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResp) Descriptor deprecated

This method has been deprecated.
func (*LoginResp) Descriptor() ([]byte, []int)

Deprecated: Use LoginResp.ProtoReflect.Descriptor instead.

func (*LoginResp) GetAccount

func (x *LoginResp) GetAccount() string

func (*LoginResp) GetChannelId

func (x *LoginResp) GetChannelId() string

func (*LoginResp) ProtoMessage

func (*LoginResp) ProtoMessage()

func (*LoginResp) ProtoReflect

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

func (*LoginResp) Reset

func (x *LoginResp) Reset()

func (*LoginResp) String

func (x *LoginResp) String() string

type Member

type Member struct {
	Account  string `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
	Alias    string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"`
	Avatar   string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"`
	JoinTime int64  `protobuf:"varint,4,opt,name=join_time,json=joinTime,proto3" json:"join_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Member) Descriptor deprecated

This method has been deprecated.
func (*Member) Descriptor() ([]byte, []int)

Deprecated: Use Member.ProtoReflect.Descriptor instead.

func (*Member) GetAccount

func (x *Member) GetAccount() string

func (*Member) GetAlias

func (x *Member) GetAlias() string

func (*Member) GetAvatar

func (x *Member) GetAvatar() string

func (*Member) GetJoinTime

func (x *Member) GetJoinTime() int64

func (*Member) ProtoMessage

func (*Member) ProtoMessage()

func (*Member) ProtoReflect

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

func (*Member) Reset

func (x *Member) Reset()

func (*Member) String

func (x *Member) String() string

type MessageAckReq

type MessageAckReq struct {
	MessageId int64 `protobuf:"varint,1,opt,name=messageId,proto3" json:"messageId,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageAckReq) Descriptor deprecated

This method has been deprecated.
func (*MessageAckReq) Descriptor() ([]byte, []int)

Deprecated: Use MessageAckReq.ProtoReflect.Descriptor instead.

func (*MessageAckReq) GetMessageId

func (x *MessageAckReq) GetMessageId() int64

func (*MessageAckReq) ProtoMessage

func (*MessageAckReq) ProtoMessage()

func (*MessageAckReq) ProtoReflect

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

func (*MessageAckReq) Reset

func (x *MessageAckReq) Reset()

func (*MessageAckReq) String

func (x *MessageAckReq) String() string

type MessageContent

type MessageContent struct {
	MessageId int64  `protobuf:"varint,1,opt,name=messageId,proto3" json:"messageId,omitempty"`
	Type      int32  `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	Body      string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	Extra     string `protobuf:"bytes,4,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageContent) Descriptor deprecated

This method has been deprecated.
func (*MessageContent) Descriptor() ([]byte, []int)

Deprecated: Use MessageContent.ProtoReflect.Descriptor instead.

func (*MessageContent) GetBody

func (x *MessageContent) GetBody() string

func (*MessageContent) GetExtra

func (x *MessageContent) GetExtra() string

func (*MessageContent) GetMessageId

func (x *MessageContent) GetMessageId() int64

func (*MessageContent) GetType

func (x *MessageContent) GetType() int32

func (*MessageContent) ProtoMessage

func (*MessageContent) ProtoMessage()

func (*MessageContent) ProtoReflect

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

func (*MessageContent) Reset

func (x *MessageContent) Reset()

func (*MessageContent) String

func (x *MessageContent) String() string

type MessageContentReq

type MessageContentReq struct {
	MessageIds []int64 `protobuf:"varint,1,rep,packed,name=message_ids,json=messageIds,proto3" json:"message_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageContentReq) Descriptor deprecated

This method has been deprecated.
func (*MessageContentReq) Descriptor() ([]byte, []int)

Deprecated: Use MessageContentReq.ProtoReflect.Descriptor instead.

func (*MessageContentReq) GetMessageIds

func (x *MessageContentReq) GetMessageIds() []int64

func (*MessageContentReq) ProtoMessage

func (*MessageContentReq) ProtoMessage()

func (*MessageContentReq) ProtoReflect

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

func (*MessageContentReq) Reset

func (x *MessageContentReq) Reset()

func (*MessageContentReq) String

func (x *MessageContentReq) String() string

type MessageContentResp

type MessageContentResp struct {
	Contents []*MessageContent `protobuf:"bytes,1,rep,name=contents,proto3" json:"contents,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageContentResp) Descriptor deprecated

This method has been deprecated.
func (*MessageContentResp) Descriptor() ([]byte, []int)

Deprecated: Use MessageContentResp.ProtoReflect.Descriptor instead.

func (*MessageContentResp) GetContents

func (x *MessageContentResp) GetContents() []*MessageContent

func (*MessageContentResp) ProtoMessage

func (*MessageContentResp) ProtoMessage()

func (*MessageContentResp) ProtoReflect

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

func (*MessageContentResp) Reset

func (x *MessageContentResp) Reset()

func (*MessageContentResp) String

func (x *MessageContentResp) String() string

type MessageIndex

type MessageIndex struct {
	MessageId int64  `protobuf:"varint,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	Direction int32  `protobuf:"varint,2,opt,name=direction,proto3" json:"direction,omitempty"`
	SendTime  int64  `protobuf:"varint,3,opt,name=send_time,json=sendTime,proto3" json:"send_time,omitempty"`
	AccountB  string `protobuf:"bytes,4,opt,name=accountB,proto3" json:"accountB,omitempty"`
	Group     string `protobuf:"bytes,5,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageIndex) Descriptor deprecated

This method has been deprecated.
func (*MessageIndex) Descriptor() ([]byte, []int)

Deprecated: Use MessageIndex.ProtoReflect.Descriptor instead.

func (*MessageIndex) GetAccountB

func (x *MessageIndex) GetAccountB() string

func (*MessageIndex) GetDirection

func (x *MessageIndex) GetDirection() int32

func (*MessageIndex) GetGroup

func (x *MessageIndex) GetGroup() string

func (*MessageIndex) GetMessageId

func (x *MessageIndex) GetMessageId() int64

func (*MessageIndex) GetSendTime

func (x *MessageIndex) GetSendTime() int64

func (*MessageIndex) ProtoMessage

func (*MessageIndex) ProtoMessage()

func (*MessageIndex) ProtoReflect

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

func (*MessageIndex) Reset

func (x *MessageIndex) Reset()

func (*MessageIndex) String

func (x *MessageIndex) String() string

type MessageIndexReq

type MessageIndexReq struct {
	MessageId int64 `protobuf:"varint,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageIndexReq) Descriptor deprecated

This method has been deprecated.
func (*MessageIndexReq) Descriptor() ([]byte, []int)

Deprecated: Use MessageIndexReq.ProtoReflect.Descriptor instead.

func (*MessageIndexReq) GetMessageId

func (x *MessageIndexReq) GetMessageId() int64

func (*MessageIndexReq) ProtoMessage

func (*MessageIndexReq) ProtoMessage()

func (*MessageIndexReq) ProtoReflect

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

func (*MessageIndexReq) Reset

func (x *MessageIndexReq) Reset()

func (*MessageIndexReq) String

func (x *MessageIndexReq) String() string

type MessageIndexResp

type MessageIndexResp struct {
	Indexes []*MessageIndex `protobuf:"bytes,1,rep,name=indexes,proto3" json:"indexes,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageIndexResp) Descriptor deprecated

This method has been deprecated.
func (*MessageIndexResp) Descriptor() ([]byte, []int)

Deprecated: Use MessageIndexResp.ProtoReflect.Descriptor instead.

func (*MessageIndexResp) GetIndexes

func (x *MessageIndexResp) GetIndexes() []*MessageIndex

func (*MessageIndexResp) ProtoMessage

func (*MessageIndexResp) ProtoMessage()

func (*MessageIndexResp) ProtoReflect

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

func (*MessageIndexResp) Reset

func (x *MessageIndexResp) Reset()

func (*MessageIndexResp) String

func (x *MessageIndexResp) String() string

type MessagePush

type MessagePush struct {
	MessageId int64  `protobuf:"varint,1,opt,name=messageId,proto3" json:"messageId,omitempty"`
	Type      int32  `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	Body      string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	Extra     string `protobuf:"bytes,4,opt,name=extra,proto3" json:"extra,omitempty"`
	Sender    string `protobuf:"bytes,5,opt,name=sender,proto3" json:"sender,omitempty"`
	SendTime  int64  `protobuf:"varint,6,opt,name=sendTime,proto3" json:"sendTime,omitempty"`
	// contains filtered or unexported fields
}

func (*MessagePush) Descriptor deprecated

This method has been deprecated.
func (*MessagePush) Descriptor() ([]byte, []int)

Deprecated: Use MessagePush.ProtoReflect.Descriptor instead.

func (*MessagePush) GetBody

func (x *MessagePush) GetBody() string

func (*MessagePush) GetExtra

func (x *MessagePush) GetExtra() string

func (*MessagePush) GetMessageId

func (x *MessagePush) GetMessageId() int64

func (*MessagePush) GetSendTime

func (x *MessagePush) GetSendTime() int64

func (*MessagePush) GetSender

func (x *MessagePush) GetSender() string

func (*MessagePush) GetType

func (x *MessagePush) GetType() int32

func (*MessagePush) ProtoMessage

func (*MessagePush) ProtoMessage()

func (*MessagePush) ProtoReflect

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

func (*MessagePush) Reset

func (x *MessagePush) Reset()

func (*MessagePush) String

func (x *MessagePush) String() string

type MessageReq

type MessageReq struct {
	Type  int32  `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	Body  string `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	Extra string `protobuf:"bytes,3,opt,name=extra,proto3" json:"extra,omitempty"`
	// contains filtered or unexported fields
}

chat message

func (*MessageReq) Descriptor deprecated

This method has been deprecated.
func (*MessageReq) Descriptor() ([]byte, []int)

Deprecated: Use MessageReq.ProtoReflect.Descriptor instead.

func (*MessageReq) GetBody

func (x *MessageReq) GetBody() string

func (*MessageReq) GetExtra

func (x *MessageReq) GetExtra() string

func (*MessageReq) GetType

func (x *MessageReq) GetType() int32

func (*MessageReq) ProtoMessage

func (*MessageReq) ProtoMessage()

func (*MessageReq) ProtoReflect

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

func (*MessageReq) Reset

func (x *MessageReq) Reset()

func (*MessageReq) String

func (x *MessageReq) String() string

type MessageResp

type MessageResp struct {
	MessageId int64 `protobuf:"varint,1,opt,name=messageId,proto3" json:"messageId,omitempty"`
	SendTime  int64 `protobuf:"varint,2,opt,name=sendTime,proto3" json:"sendTime,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageResp) Descriptor deprecated

This method has been deprecated.
func (*MessageResp) Descriptor() ([]byte, []int)

Deprecated: Use MessageResp.ProtoReflect.Descriptor instead.

func (*MessageResp) GetMessageId

func (x *MessageResp) GetMessageId() int64

func (*MessageResp) GetSendTime

func (x *MessageResp) GetSendTime() int64

func (*MessageResp) ProtoMessage

func (*MessageResp) ProtoMessage()

func (*MessageResp) ProtoReflect

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

func (*MessageResp) Reset

func (x *MessageResp) Reset()

func (*MessageResp) String

func (x *MessageResp) String() string

type Meta

type Meta struct {
	Key   string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Type  MetaType `protobuf:"varint,3,opt,name=type,proto3,enum=pkt.MetaType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Meta) Descriptor deprecated

This method has been deprecated.
func (*Meta) Descriptor() ([]byte, []int)

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetKey

func (x *Meta) GetKey() string

func (*Meta) GetType

func (x *Meta) GetType() MetaType

func (*Meta) GetValue

func (x *Meta) GetValue() string

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type MetaType

type MetaType int32
const (
	MetaType_int    MetaType = 0
	MetaType_string MetaType = 1
	MetaType_float  MetaType = 2
)

func (MetaType) Descriptor

func (MetaType) Descriptor() protoreflect.EnumDescriptor

func (MetaType) Enum

func (x MetaType) Enum() *MetaType

func (MetaType) EnumDescriptor deprecated

This method has been deprecated.
func (MetaType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetaType.Descriptor instead.

func (MetaType) Number

func (x MetaType) Number() protoreflect.EnumNumber

func (MetaType) String

func (x MetaType) String() string

func (MetaType) Type

type Packet

type Packet interface {
	Decode(r io.Reader) error
	Encode(w io.Writer) error
}

type Session

type Session struct {
	ChannelId string   `protobuf:"bytes,1,opt,name=channelId,proto3" json:"channelId,omitempty"` // session id
	GateId    string   `protobuf:"bytes,2,opt,name=gateId,proto3" json:"gateId,omitempty"`       // gateway ID
	Account   string   `protobuf:"bytes,3,opt,name=account,proto3" json:"account,omitempty"`
	Zone      string   `protobuf:"bytes,4,opt,name=zone,proto3" json:"zone,omitempty"`
	Isp       string   `protobuf:"bytes,5,opt,name=isp,proto3" json:"isp,omitempty"`
	RemoteIP  string   `protobuf:"bytes,6,opt,name=remoteIP,proto3" json:"remoteIP,omitempty"`
	Device    string   `protobuf:"bytes,7,opt,name=device,proto3" json:"device,omitempty"`
	App       string   `protobuf:"bytes,8,opt,name=app,proto3" json:"app,omitempty"`
	Tags      []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) Descriptor deprecated

This method has been deprecated.
func (*Session) Descriptor() ([]byte, []int)

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetAccount

func (x *Session) GetAccount() string

func (*Session) GetApp

func (x *Session) GetApp() string

func (*Session) GetChannelId

func (x *Session) GetChannelId() string

func (*Session) GetDevice

func (x *Session) GetDevice() string

func (*Session) GetGateId

func (x *Session) GetGateId() string

func (*Session) GetIsp

func (x *Session) GetIsp() string

func (*Session) GetRemoteIP

func (x *Session) GetRemoteIP() string

func (*Session) GetTags

func (x *Session) GetTags() []string

func (*Session) GetZone

func (x *Session) GetZone() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type Status

type Status int32

status is a uint16 value

const (
	Status_Success Status = 0 // client defined
	// client error 100-200
	Status_NoDestination     Status = 100
	Status_InvalidPacketBody Status = 101
	Status_InvalidCommand    Status = 103
	Status_Unauthorized      Status = 105
	// server error 300-400
	Status_SystemException Status = 300
	Status_NotImplemented  Status = 301
	//specific error
	Status_SessionNotFound Status = 404 // session lost
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

This method has been deprecated.
func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL