wire

package
v0.0.0-...-69995ca Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// login
	CommandLoginSignIn  = "login.signin"
	CommandLoginSignOut = "login.signout"

	// chat
	CommandChatUserTalk  = "chat.user.talk"
	CommandChatGroupTalk = "chat.group.talk"
	CommandChatTalkAck   = "chat.talk.ack"

	// 离线
	CommandOfflineIndex   = "chat.offline.index"
	CommandOfflineContent = "chat.offline.content"

	// 群管理
	CommandGroupCreate  = "chat.group.create"
	CommandGroupJoin    = "chat.group.join"
	CommandGroupQuit    = "chat.group.quit"
	CommandGroupMembers = "chat.group.members"
	CommandGroupDetail  = "chat.group.detail"
)

Command defined data type between client and server

View Source
const (
	// 消息将要送达的网关的ServiceName
	MetaDestServer = "dest.server"
	// 消息将要送达的channels
	MetaDestChannels = "dest.channels"
)

Meta Key of a packet

View Source
const (
	SNWGateway = "wgateway"
	SNTGateway = "tgateway"
	SNLogin    = "chat"  //login
	SNChat     = "chat"  //chat
	SNService  = "royal" //rpc service
)

Service Name 定义统一的服务名

View Source
const (
	OfflineReadIndexExpiresIn = time.Hour * 24 * 30 // 读索引在缓存中的过期时间
	OfflineSyncIndexCount     = 2000                //单次同步消息索引的数量
	OfflineMessageExpiresIn   = 15                  // 离线消息过期时间
	MessageMaxCountPerPage    = 200                 // 同步消息内容时每页的最大数据
)
View Source
const (
	MessageTypeText  = 1
	MessageTypeImage = 2
	MessageTypeVoice = 3
	MessageTypeVideo = 4
)
View Source
const (
	AlgorithmHashSlots = "hashslots"
)

algorithm in routing

Variables

View Source
var (
	MagicLogicPkt = Magic{0xc3, 0x11, 0xa3, 0x65}
	MagicBasicPkt = Magic{0xc3, 0x15, 0xa7, 0x65}
)
View Source
var Seq = sequence{/* contains filtered or unexported fields */}

Seq Seq

Functions

func IsGrpcError

func IsGrpcError(err error, code codes.Code) bool

IsGrpcError check err type with a grpc status

Types

type Magic

type Magic [4]byte

type Protocol

type Protocol string

Protocol Protocol

const (
	ProtocolTCP       Protocol = "tcp"
	ProtocolWebsocket Protocol = "websocket"
)

Protocol

type ServiceID

type ServiceID string

ServiceID ServiceID

type SessionID

type SessionID string

SessionID SessionID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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