sdk

package
v0.0.0-...-d4bbc0e Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeText      = "text"
	MsgTypeAck       = "ack"
	MsgTypeReConn    = "reConn"
	MsgTypeHeartbeat = "heartbeat"
	MsgLogin         = "loginMsg"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Nick      string
	UserID    string
	SessionId string

	MsgClientIDTable map[string]uint64
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewChat

func NewChat(ip net.IP, port int, nick, userID, sessionID string) *Chat

func (*Chat) Close

func (chat *Chat) Close()

func (*Chat) GetCurClientID

func (chat *Chat) GetCurClientID() uint64

func (*Chat) ReConn

func (chat *Chat) ReConn()

func (*Chat) Recv

func (chat *Chat) Recv() <-chan *Message

func (*Chat) Send

func (chat *Chat) Send(msg *Message)

type Message

type Message struct {
	Type       string
	Name       string
	FormUserID string
	ToUserID   string
	Content    string
	Session    string
}

Jump to

Keyboard shortcuts

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