Documentation ¶
Index ¶
- Constants
- func BroadcastFilterJson(msg interface{}, fn func(*melody.Session) bool) error
- func BroadcastJson(bizType string, msg string, data interface{}) error
- func BroadcastMultipleJson(sessions []*melody.Session, bizType string, msg string, data interface{}) error
- func BroadcastOthersJson(s *melody.Session, bizType string, msg string, data interface{}) error
- func WriteFailJson(s *melody.Session, bizType string, msg string, data ...interface{}) error
- func WriteFailJsonExit(s *melody.Session, bizType string, msg string, data ...interface{}) error
- func WriteJson(s *melody.Session, bizType string, code int, msg string, data ...interface{}) error
- func WriteJsonExit(s *melody.Session, bizType string, code int, msg string, data ...interface{}) error
- func WriteSusJson(s *melody.Session, bizType string, msg string, data ...interface{}) error
- func WriteSusJsonExit(s *melody.Session, bizType string, msg string, data ...interface{}) error
- type SecondsTimer
- type ServerMsg
Constants ¶
View Source
const ( SuccessCode int = 0 ErrorCode int = -1 )
Variables ¶
This section is empty.
Functions ¶
func BroadcastFilterJson ¶
BroadcastFilterJson broadcasts a text message to all sessions that fn returns true for.
func BroadcastJson ¶
BroadcastJson Broadcast broadcasts a text message to all sessions.
func BroadcastMultipleJson ¶
func BroadcastMultipleJson(sessions []*melody.Session, bizType string, msg string, data interface{}) error
BroadcastMultipleJson broadcasts a text message to multiple sessions given in the sessions slice.
func BroadcastOthersJson ¶
BroadcastOthersJson BroadcastOthers broadcasts a text message to all sessions except session s.
func WriteFailJson ¶
func WriteFailJsonExit ¶
func WriteJsonExit ¶
func WriteSusJson ¶
Types ¶
type SecondsTimer ¶
func NewSecondsTimer ¶
func NewSecondsTimer(t time.Duration) *SecondsTimer
func (*SecondsTimer) Reset ¶
func (s *SecondsTimer) Reset(t time.Duration)
func (*SecondsTimer) Stop ¶
func (s *SecondsTimer) Stop()
func (*SecondsTimer) TimeRemaining ¶
func (s *SecondsTimer) TimeRemaining() time.Duration
Click to show internal directories.
Click to hide internal directories.