job

package
v0.0.0-...-261bb52 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RPCClientList map[int8]client.XClient

RPCClientList is list of CometRPC

View Source
var (
	// RedisCli is Client of redis
	RedisCli *redis.Client
)

Functions

func InitComets

func InitComets() (err error)

InitComets is func to initial CometRPC client

func InitPush

func InitPush()

InitPush is func to initial push msg

func InitRedis

func InitRedis() (err error)

InitRedis is func to initial redis

Types

type CometRPC

type CometRPC int

CometRPC is comet rpc Client

type NoReply

type NoReply struct {
}

NoReply is struct of no reply

type Operation

type Operation int

Operation defines the type of operation.

const (

	// OpSingleSend 指定用户发送
	OpSingleSend Operation
	// OpRoomSend 广播到房间操作
	OpRoomSend
)

type Proto

type Proto struct {
	Ver       int16           `json:"ver"`  // protocol version
	Operation Operation       `json:"op"`   // operation for request
	Body      json.RawMessage `json:"body"` // binary body bytes(json.RawMessage is []byte)

}

Proto is struct of msg protocol

type PushMsgArg

type PushMsgArg struct {
	UID string
	P   Proto
}

PushMsgArg is struct of push msg

type RedisMsg

type RedisMsg struct {
	Carrier      []byte            `json:"carrier"` // 携带trace信息
	Op           Operation         `json:"op"`
	ServerID     int8              `json:"serverID,omitempty"`
	RoomID       string            `json:"roomID,omitempty"`
	UserID       string            `json:"userID,omitempty"`
	Msg          []byte            `json:"msg"`
	Count        int               `json:"count"`
	RoomUserInfo map[string]string `json:"RoomUserInfo"`
}

RedisMsg is struct of RedisMsg

type RoomMsgArg

type RoomMsgArg struct {
	RoomID string
	P      Proto
}

RoomMsgArg is struct of room msg arg

type SuccessReply

type SuccessReply struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

SuccessReply is struct of success reply

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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