gate

package
v0.0.0-...-17d8d8c Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2018 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUndefineMethod 方法未定义.
	ErrUndefineMethod = errors.New("undefine method")
	// ErrInvalidState 当前用户离线或未登录.
	ErrInvalidState = errors.New("invalid context")
)

Functions

This section is empty.

Types

type Gate

type Gate struct {
	// contains filtered or unexported fields
}

Gate recv client request.

func NewGate

func NewGate(host, master, notifer, store string) (*Gate, error)

NewGate new gate server.

func (*Gate) CheckFile

CheckFile 客户端检测文件是否存在,文件的临时ID和md5, 服务器返回不存在的文件ID.

func (*Gate) DownloadFile

DownloadFile 客户端下载文件,传入ID,返回具体文件内容.

func (*Gate) FindUser

FindUser 添加好友前先查找,模糊查找

func (*Gate) Friend

Friend 添加好友或确认接受添加.

func (*Gate) GetUserInfo

GetUserInfo get user base info

func (*Gate) Group

Group 添加,邀请,退出, 踢出

func (*Gate) GroupCreate

GroupCreate 用户创建一个聊天组.

func (*Gate) GroupDelete

GroupDelete 解散一个群.

func (*Gate) Heartbeat

func (g *Gate) Heartbeat(ctx context.Context, req *meta.HeartbeatRequest) (*meta.HeartbeatResponse, error)

Heartbeat 心跳,重写这个主要是方便附加消息

func (*Gate) LoadFriendList

LoadFriendList 加载好友列表

func (*Gate) LoadGroupList

LoadGroupList 加载群组列表

func (*Gate) LoadMessage

LoadMessage 客户端同步离线消息,每次可逆序(旧消息)或正序(新消息)接收100条

func (*Gate) LoadRecentContact

LoadRecentContact 最近联系人列表

func (*Gate) Login

Login user,passwd.

func (*Gate) Logout

Logout nil.

func (*Gate) Push

func (g *Gate) Push(ctx context.Context, req *meta.PushRequest) (*meta.PushResponse, error)

Push notifer 调用的接口, 如果用户不在,要返回错误.

func (*Gate) Register

Register user, passwd.

func (*Gate) SendMessage

SendMessage 发送消息

func (*Gate) Stream

func (g *Gate) Stream(req *meta.GateStreamRequest, stream meta.Gate_StreamServer) error

Stream 客户端登录后调用这个接口,接收下推消息

func (*Gate) UpdateSignature

UpdateSignature update user Signature

func (*Gate) UpdateUserInfo

UpdateUserInfo nickname, avatar.

func (*Gate) UpdateUserPassword

UpdateUserPassword update user password

func (*Gate) UploadFile

UploadFile 客户端上传文件接口,一次一个文件.

Jump to

Keyboard shortcuts

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