Documentation ¶
Index ¶
- Constants
- func IMDBEnd(receiver string) []byte
- func IMDBKey(receiver string, seq int64) []byte
- func InitConfig(c *Config)
- type ChatHandler
- type Config
- type OnlineMap
- type PushDelegate
- type Service
- func (ws *Service) DebugInfo(online, local bool, usr string) string
- func (ws *Service) ImmediateMsgForP2pNetwork(w *worker.TopicWorker)
- func (ws *Service) OnOffLineForP2pNetwork(w *worker.TopicWorker)
- func (ws *Service) ProcOnlineMapRequestFromP2pNetwork(stream network.Stream)
- func (ws *Service) ShutDown()
- func (ws *Service) StartService(nodeID string)
- func (ws *Service) SyncOnlineSetFromPeerNodes(stream network.Stream) error
- type UserLevel
- type UserTable
- type WsMsgBuffer
Constants ¶
View Source
const ( DefaultHost = "0.0.0.0" DefaultPongWait = 60 * time.Second DefaultPingPeriod = (DefaultPongWait * 9) / 10 DefaultWriteWait = 40 * time.Second DefaultWsBuffer = 1 << 23 DefaultWsMsgNoFromCli = 1 << 8 DefaultUnreadMsgNoPerQuery = 1 << 13 DefaultHandShakeTimeOut = time.Second * 3 DefaultDataBaseDir = "Msg" )
View Source
const ( MSGPatternHead = "TempCachedMsg0" MSGPatternEnd = "TempCachedMsg1" )
View Source
const ( CPUserOnline = "/user/online" CPUserCheck = "/user/check" WSThreadName = "websocket main service thread" PushThreadName = "push delegate service thread" DispatchThreadName = "websocket message dispatcher thread" DatabaseThreadName = "database dirty data keeper" DirtyDataKeepInterval = time.Minute * 15 DataKeptLength = time.Hour * 24 * 7 OnlineStreamDelim byte = '@' )
View Source
const ( MaxPushChanNo = 1 << 12 MaxPushOnline = 1 << 10 PushServiceStatusTimer = time.Second * 15 )
View Source
const ( FreePackSize = 1 << 10 BronzePackSize = 5 * (1 << 20) SilverPackSize = 20 * (1 << 20) GoldPackSize = 100 * (1 << 20) )
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func InitConfig(c *Config)
Types ¶
type ChatHandler ¶
type ChatHandler func(http.ResponseWriter, *http.Request)
type Config ¶
type Config struct { PingPeriod time.Duration `json:"ping.timeout"` PongWait time.Duration `json:"pong.timeout"` WriteWait time.Duration `json:"write.timeout"` HandShakeTimeout time.Duration `json:"handshake.timeout"` WsIOBufferSize utils.ByteSize `json:"io.buffer.size"` MaxUnreadMsgNoPerQuery int `json:"max.unread.size"` WsMsgNoFromCli int `json:"max.client.msg.no"` WsIP string `json:"ws.ip"` WsPort int16 `json:"ws.port"` DataBaseDir string `json:"ws.msg.database"` }
func DefaultConfig ¶
type OnlineMap ¶
func (*OnlineMap) DumpContent ¶
type PushDelegate ¶ added in v1.2.2
func (*PushDelegate) Push ¶ added in v1.2.2
func (d *PushDelegate) Push(userID, msg string)
func (*PushDelegate) Start ¶ added in v1.2.2
func (d *PushDelegate) Start(stop chan struct{})
func (*PushDelegate) TokenOnline ¶ added in v1.2.2
func (d *PushDelegate) TokenOnline(on *pbs.WSOnline)
type Service ¶
type Service struct { IMP2pWorker *worker.TopicWorker // contains filtered or unexported fields }
func (*Service) ImmediateMsgForP2pNetwork ¶
func (ws *Service) ImmediateMsgForP2pNetwork(w *worker.TopicWorker)
func (*Service) OnOffLineForP2pNetwork ¶
func (ws *Service) OnOffLineForP2pNetwork(w *worker.TopicWorker)
func (*Service) ProcOnlineMapRequestFromP2pNetwork ¶ added in v1.2.2
func (*Service) StartService ¶
type UserLevel ¶ added in v1.2.2
type UserLevel int8
func (UserLevel) CheckMessage ¶ added in v1.2.2
type UserTable ¶
func (*UserTable) DumpContent ¶
type WsMsgBuffer ¶
type WsMsgBuffer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.