websocket

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WsMsgType_name = map[int32]string{
		0:  "Online",
		1:  "OnlineACK",
		2:  "IMData",
		3:  "PullUnread",
		4:  "Offline",
		5:  "UnreadAck",
		15: "NoRight",
	}
	WsMsgType_value = map[string]int32{
		"Online":     0,
		"OnlineACK":  1,
		"IMData":     2,
		"PullUnread": 3,
		"Offline":    4,
		"UnreadAck":  5,
		"NoRight":    15,
	}
)

Enum value maps for WsMsgType.

View Source
var File_websocket_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type GroupTo added in v1.2.2

type GroupTo struct {
	GrpID  string            `protobuf:"bytes,1,opt,name=grpID,proto3" json:"grpID,omitempty"`
	AesKey map[string][]byte `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GroupTo) Descriptor deprecated added in v1.2.2

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

Deprecated: Use GroupTo.ProtoReflect.Descriptor instead.

func (*GroupTo) GetAesKey added in v1.2.2

func (x *GroupTo) GetAesKey() map[string][]byte

func (*GroupTo) GetGrpID added in v1.2.2

func (x *GroupTo) GetGrpID() string

func (*GroupTo) ProtoMessage added in v1.2.2

func (*GroupTo) ProtoMessage()

func (*GroupTo) ProtoReflect added in v1.2.2

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

func (*GroupTo) Reset added in v1.2.2

func (x *GroupTo) Reset()

func (*GroupTo) String added in v1.2.2

func (x *GroupTo) String() string

type MsgReceiver added in v1.2.2

type MsgReceiver struct {

	// Types that are assignable to To:
	//	*MsgReceiver_PeerAddr
	//	*MsgReceiver_Grp
	To isMsgReceiver_To `protobuf_oneof:"To"`
	// contains filtered or unexported fields
}

func (*MsgReceiver) Descriptor deprecated added in v1.2.2

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

Deprecated: Use MsgReceiver.ProtoReflect.Descriptor instead.

func (*MsgReceiver) GetGrp added in v1.2.2

func (x *MsgReceiver) GetGrp() *GroupTo

func (*MsgReceiver) GetPeerAddr added in v1.2.2

func (x *MsgReceiver) GetPeerAddr() string

func (*MsgReceiver) GetTo added in v1.2.2

func (m *MsgReceiver) GetTo() isMsgReceiver_To

func (*MsgReceiver) ProtoMessage added in v1.2.2

func (*MsgReceiver) ProtoMessage()

func (*MsgReceiver) ProtoReflect added in v1.2.2

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

func (*MsgReceiver) Reset added in v1.2.2

func (x *MsgReceiver) Reset()

func (*MsgReceiver) String added in v1.2.2

func (x *MsgReceiver) String() string

type MsgReceiver_Grp added in v1.2.2

type MsgReceiver_Grp struct {
	Grp *GroupTo `protobuf:"bytes,2,opt,name=grp,proto3,oneof"`
}

type MsgReceiver_PeerAddr added in v1.2.2

type MsgReceiver_PeerAddr struct {
	PeerAddr string `protobuf:"bytes,1,opt,name=peerAddr,proto3,oneof"`
}

type WSCryptoMsg

type WSCryptoMsg struct {
	From     string       `protobuf:"bytes,1,opt,name=From,proto3" json:"From,omitempty"`
	To       *MsgReceiver `protobuf:"bytes,2,opt,name=To,proto3" json:"To,omitempty"`
	PayLoad  []byte       `protobuf:"bytes,4,opt,name=PayLoad,proto3" json:"PayLoad,omitempty"`
	UnixTime int64        `protobuf:"varint,5,opt,name=UnixTime,proto3" json:"UnixTime,omitempty"`
	// contains filtered or unexported fields
}

func (*WSCryptoMsg) Descriptor deprecated

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

Deprecated: Use WSCryptoMsg.ProtoReflect.Descriptor instead.

func (*WSCryptoMsg) GetFrom

func (x *WSCryptoMsg) GetFrom() string

func (*WSCryptoMsg) GetPayLoad

func (x *WSCryptoMsg) GetPayLoad() []byte

func (*WSCryptoMsg) GetTo

func (x *WSCryptoMsg) GetTo() *MsgReceiver

func (*WSCryptoMsg) GetUnixTime

func (x *WSCryptoMsg) GetUnixTime() int64

func (*WSCryptoMsg) MustData

func (x *WSCryptoMsg) MustData() []byte

func (*WSCryptoMsg) ProtoMessage

func (*WSCryptoMsg) ProtoMessage()

func (*WSCryptoMsg) ProtoReflect

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

func (*WSCryptoMsg) Reset

func (x *WSCryptoMsg) Reset()

func (*WSCryptoMsg) String

func (x *WSCryptoMsg) String() string

type WSNoRightTips added in v1.2.2

type WSNoRightTips struct {
	From     string `protobuf:"bytes,1,opt,name=From,proto3" json:"From,omitempty"`
	To       string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	IsGrp    bool   `protobuf:"varint,3,opt,name=isGrp,proto3" json:"isGrp,omitempty"`
	UnixTime int64  `protobuf:"varint,6,opt,name=UnixTime,proto3" json:"UnixTime,omitempty"`
	// contains filtered or unexported fields
}

func (*WSNoRightTips) Descriptor deprecated added in v1.2.2

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

Deprecated: Use WSNoRightTips.ProtoReflect.Descriptor instead.

func (*WSNoRightTips) GetFrom added in v1.2.2

func (x *WSNoRightTips) GetFrom() string

func (*WSNoRightTips) GetIsGrp added in v1.2.2

func (x *WSNoRightTips) GetIsGrp() bool

func (*WSNoRightTips) GetTo added in v1.2.2

func (x *WSNoRightTips) GetTo() string

func (*WSNoRightTips) GetUnixTime added in v1.2.2

func (x *WSNoRightTips) GetUnixTime() int64

func (*WSNoRightTips) ProtoMessage added in v1.2.2

func (*WSNoRightTips) ProtoMessage()

func (*WSNoRightTips) ProtoReflect added in v1.2.2

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

func (*WSNoRightTips) Reset added in v1.2.2

func (x *WSNoRightTips) Reset()

func (*WSNoRightTips) String added in v1.2.2

func (x *WSNoRightTips) String() string

type WSOnline

type WSOnline struct {
	UID      string `protobuf:"bytes,1,opt,name=UID,proto3" json:"UID,omitempty"`
	UnixTime int64  `protobuf:"varint,3,opt,name=UnixTime,proto3" json:"UnixTime,omitempty"`
	DevToken string `protobuf:"bytes,4,opt,name=devToken,proto3" json:"devToken,omitempty"`
	DevTyp   int32  `protobuf:"varint,5,opt,name=devTyp,proto3" json:"devTyp,omitempty"`
	Debug    bool   `protobuf:"varint,2,opt,name=debug,proto3" json:"debug,omitempty"`
	// contains filtered or unexported fields
}

func (*WSOnline) Descriptor deprecated

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

Deprecated: Use WSOnline.ProtoReflect.Descriptor instead.

func (*WSOnline) GetDebug added in v1.2.2

func (x *WSOnline) GetDebug() bool

func (*WSOnline) GetDevToken

func (x *WSOnline) GetDevToken() string

func (*WSOnline) GetDevTyp

func (x *WSOnline) GetDevTyp() int32

func (*WSOnline) GetUID

func (x *WSOnline) GetUID() string

func (*WSOnline) GetUnixTime

func (x *WSOnline) GetUnixTime() int64

func (*WSOnline) ProtoMessage

func (*WSOnline) ProtoMessage()

func (*WSOnline) ProtoReflect

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

func (*WSOnline) Reset

func (x *WSOnline) Reset()

func (*WSOnline) String

func (x *WSOnline) String() string

func (*WSOnline) Verify

func (x *WSOnline) Verify(sig []byte) bool

type WSOnlineAck

type WSOnlineAck struct {
	Success bool  `protobuf:"varint,1,opt,name=Success,proto3" json:"Success,omitempty"`
	Seq     int64 `protobuf:"varint,2,opt,name=Seq,proto3" json:"Seq,omitempty"`
	// contains filtered or unexported fields
}

func (*WSOnlineAck) Descriptor deprecated

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

Deprecated: Use WSOnlineAck.ProtoReflect.Descriptor instead.

func (*WSOnlineAck) GetSeq

func (x *WSOnlineAck) GetSeq() int64

func (*WSOnlineAck) GetSuccess

func (x *WSOnlineAck) GetSuccess() bool

func (*WSOnlineAck) ProtoMessage

func (*WSOnlineAck) ProtoMessage()

func (*WSOnlineAck) ProtoReflect

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

func (*WSOnlineAck) Reset

func (x *WSOnlineAck) Reset()

func (*WSOnlineAck) String

func (x *WSOnlineAck) String() string

type WSPullUnread

type WSPullUnread struct {
	Receiver     string `protobuf:"bytes,1,opt,name=Receiver,proto3" json:"Receiver,omitempty"`
	FromUnixTime int64  `protobuf:"varint,2,opt,name=FromUnixTime,proto3" json:"FromUnixTime,omitempty"`
	// contains filtered or unexported fields
}

func (*WSPullUnread) Descriptor deprecated

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

Deprecated: Use WSPullUnread.ProtoReflect.Descriptor instead.

func (*WSPullUnread) GetFromUnixTime

func (x *WSPullUnread) GetFromUnixTime() int64

func (*WSPullUnread) GetReceiver

func (x *WSPullUnread) GetReceiver() string

func (*WSPullUnread) ProtoMessage

func (*WSPullUnread) ProtoMessage()

func (*WSPullUnread) ProtoReflect

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

func (*WSPullUnread) Reset

func (x *WSPullUnread) Reset()

func (*WSPullUnread) String

func (x *WSPullUnread) String() string

type WsMsg

type WsMsg struct {
	Hash []byte    `protobuf:"bytes,1,opt,name=Hash,proto3" json:"Hash,omitempty"`
	Sig  []byte    `protobuf:"bytes,2,opt,name=Sig,proto3" json:"Sig,omitempty"`
	Typ  WsMsgType `protobuf:"varint,3,opt,name=typ,proto3,enum=WsMsgType" json:"typ,omitempty"`
	// Types that are assignable to Payload:
	//	*WsMsg_Online
	//	*WsMsg_OlAck
	//	*WsMsg_Msg
	//	*WsMsg_Unread
	//	*WsMsg_UnreadAck
	//	*WsMsg_NoRightTips
	Payload isWsMsg_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

func HashNoRight added in v1.2.2

func HashNoRight(from, to string, isGroup bool) (x *WsMsg)

func (*WsMsg) CodeGroupMsg added in v1.2.2

func (x *WsMsg) CodeGroupMsg(from, to string, body []byte, grpKey map[string][]byte) ([]byte, error)

func (*WsMsg) CodeP2pMsg added in v1.2.2

func (x *WsMsg) CodeP2pMsg(from, to string, body []byte) ([]byte, error)

func (*WsMsg) Data

func (x *WsMsg) Data() []byte

func (*WsMsg) Descriptor deprecated

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

Deprecated: Use WsMsg.ProtoReflect.Descriptor instead.

func (*WsMsg) GetHash

func (x *WsMsg) GetHash() []byte

func (*WsMsg) GetMsg added in v1.2.2

func (x *WsMsg) GetMsg() *WSCryptoMsg

func (*WsMsg) GetNoRightTips added in v1.2.2

func (x *WsMsg) GetNoRightTips() *WSNoRightTips

func (*WsMsg) GetOlAck

func (x *WsMsg) GetOlAck() *WSOnlineAck

func (*WsMsg) GetOnline

func (x *WsMsg) GetOnline() *WSOnline

func (*WsMsg) GetPayload

func (m *WsMsg) GetPayload() isWsMsg_Payload

func (*WsMsg) GetSig

func (x *WsMsg) GetSig() []byte

func (*WsMsg) GetTyp

func (x *WsMsg) GetTyp() WsMsgType

func (*WsMsg) GetUnread

func (x *WsMsg) GetUnread() *WSPullUnread

func (*WsMsg) GetUnreadAck

func (x *WsMsg) GetUnreadAck() *WSCryptoMsg

func (*WsMsg) PackOnline added in v1.2.2

func (x *WsMsg) PackOnline(key *sub.SubKey, devInfo *webmsg.PushOnline) ([]byte, error)

func (*WsMsg) ProtoMessage

func (*WsMsg) ProtoMessage()

func (*WsMsg) ProtoReflect

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

func (*WsMsg) ReadOnlineFromCli

func (x *WsMsg) ReadOnlineFromCli(conn *websocket.Conn) (olMsg *WSOnline, message []byte, err error)

func (*WsMsg) Reset

func (x *WsMsg) Reset()

func (*WsMsg) String

func (x *WsMsg) String() string

type WsMsgType

type WsMsgType int32
const (
	WsMsgType_Online     WsMsgType = 0
	WsMsgType_OnlineACK  WsMsgType = 1
	WsMsgType_IMData     WsMsgType = 2
	WsMsgType_PullUnread WsMsgType = 3
	WsMsgType_Offline    WsMsgType = 4
	WsMsgType_UnreadAck  WsMsgType = 5
	WsMsgType_NoRight    WsMsgType = 15
)

func (WsMsgType) Descriptor

func (WsMsgType) Descriptor() protoreflect.EnumDescriptor

func (WsMsgType) Enum

func (x WsMsgType) Enum() *WsMsgType

func (WsMsgType) EnumDescriptor deprecated

func (WsMsgType) EnumDescriptor() ([]byte, []int)

Deprecated: Use WsMsgType.Descriptor instead.

func (WsMsgType) IsP2pIM added in v1.2.2

func (x WsMsgType) IsP2pIM() bool

func (WsMsgType) Number

func (x WsMsgType) Number() protoreflect.EnumNumber

func (WsMsgType) String

func (x WsMsgType) String() string

func (WsMsgType) Type

type WsMsg_Msg added in v1.2.2

type WsMsg_Msg struct {
	Msg *WSCryptoMsg `protobuf:"bytes,6,opt,name=msg,proto3,oneof"`
}

type WsMsg_NoRightTips added in v1.2.2

type WsMsg_NoRightTips struct {
	NoRightTips *WSNoRightTips `protobuf:"bytes,9,opt,name=noRightTips,proto3,oneof"`
}

type WsMsg_OlAck

type WsMsg_OlAck struct {
	OlAck *WSOnlineAck `protobuf:"bytes,5,opt,name=olAck,proto3,oneof"`
}

type WsMsg_Online

type WsMsg_Online struct {
	Online *WSOnline `protobuf:"bytes,4,opt,name=online,proto3,oneof"`
}

type WsMsg_Unread

type WsMsg_Unread struct {
	Unread *WSPullUnread `protobuf:"bytes,7,opt,name=unread,proto3,oneof"`
}

type WsMsg_UnreadAck

type WsMsg_UnreadAck struct {
	UnreadAck *WSCryptoMsg `protobuf:"bytes,8,opt,name=unreadAck,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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