Documentation ¶
Index ¶
- Constants
- Variables
- func CoroutineGo(fn func())
- func GenUUID() (string, error)
- func InitCoroutinePool(p *ants.Pool)
- func IsDialTimeout(err error) bool
- type Client
- func (this *Client) Close()
- func (this *Client) Dial(urlStr string, args ...interface{}) (*Conn, error)
- func (this *Client) GetConnByID(id string) *Conn
- func (this *Client) Len() int
- func (this *Client) Lists() []string
- func (this *Client) SetNetDial(fn func(network, addr string) (net.Conn, error))
- func (this *Client) SetTLSConfig(config *tls.Config)
- type ClientDialer
- type Conn
- func (this *Conn) AddCloseHandler(args ...interface{})
- func (this *Conn) AddPongHandler(args ...interface{})
- func (this *Conn) Close() error
- func (this *Conn) HandleConn(fn func(*Conn, string))
- func (this *Conn) ID() string
- func (this *Conn) Read(data []byte) (int, error)
- func (this *Conn) SetDeadline(t time.Time) error
- func (this *Conn) SetIsolatorTime(timeout time.Duration)
- func (this *Conn) StartIdlaCheck(timeout time.Duration, fns ...func(uint64, uint64))
- func (this *Conn) UnSetIsolatorTime()
- func (this *Conn) Write(data []byte) (int, error)
- func (this *Conn) WriteJSON(v interface{}) (int, error)
- func (this *Conn) WriteMessage(messageType int, data []byte) error
- func (this *Conn) WriteString(msg string) error
- type JsonEncoder
- type Server
- func (this *Server) AddAuthHandler(fn func(*Values, interface{}) bool)
- func (this *Server) AddConnectedHandler(fn func(*Conn) bool)
- func (this *Server) AddRawConnectionHandler(fn func(*Conn))
- func (this *Server) BroadCastData(data []byte) error
- func (this *Server) BroadCastJSON(v interface{}) error
- func (this *Server) BroadCastString(msg string) error
- func (this *Server) Close()
- func (this *Server) GetConnByID(id string) *Conn
- func (this *Server) Lists() []string
- func (this *Server) Upgrade(w http.ResponseWriter, r *http.Request, args ...interface{})
- func (this *Server) UpgradeWithValues(w http.ResponseWriter, r *http.Request, v *Values, args ...interface{})
- type Values
- func (this *Values) KVClear()
- func (this *Values) KVGet(key string) interface{}
- func (this *Values) KVGetBoolean(key string, def ...bool) bool
- func (this *Values) KVGetByte(key string, def ...byte) byte
- func (this *Values) KVGetInt(key string, def ...int) int
- func (this *Values) KVGetInt64(key string, def ...int64) int64
- func (this *Values) KVGetString(key string, def ...string) string
- func (this *Values) KVSet(key string, value interface{})
- func (this *Values) KVUnSet(key string)
- func (this *Values) String() string
Constants ¶
View Source
const ( WebsocketFlagClosed = iota WebsocketFlagIdle WebsocketFlagMax )
View Source
const ( FlagRunning = iota FlagClosed FlagFrozen FlagActive FlagMax )
Variables ¶
Functions ¶
func CoroutineGo ¶
func CoroutineGo(fn func())
func InitCoroutinePool ¶
func IsDialTimeout ¶
Types ¶
type Client ¶
func (*Client) GetConnByID ¶
func (*Client) SetNetDial ¶ added in v0.0.5
func (*Client) SetTLSConfig ¶
type ClientDialer ¶ added in v0.0.4
type ClientDialer struct { *Client // contains filtered or unexported fields }
func NewClientDialer ¶ added in v0.0.4
func NewClientDialer(client *Client, url string) *ClientDialer
func (*ClientDialer) Dial ¶ added in v0.0.4
func (this *ClientDialer) Dial(network, addr string) (net.Conn, error)
func (*ClientDialer) SetHandler ¶ added in v0.0.4
func (*ClientDialer) SetTimeout ¶ added in v0.0.4
func (this *ClientDialer) SetTimeout(d time.Duration)
type Conn ¶
func (*Conn) AddCloseHandler ¶
func (this *Conn) AddCloseHandler(args ...interface{})
func (*Conn) AddPongHandler ¶
func (this *Conn) AddPongHandler(args ...interface{})
func (*Conn) HandleConn ¶
func (*Conn) SetIsolatorTime ¶
func (*Conn) StartIdlaCheck ¶
func (*Conn) UnSetIsolatorTime ¶
func (this *Conn) UnSetIsolatorTime()
func (*Conn) WriteString ¶
type JsonEncoder ¶
func NewJsonEncoder ¶
func NewJsonEncoder() *JsonEncoder
func (*JsonEncoder) Bytes ¶
func (this *JsonEncoder) Bytes() []byte
func (*JsonEncoder) Encode ¶
func (this *JsonEncoder) Encode(v interface{}) error
func (*JsonEncoder) String ¶
func (this *JsonEncoder) String() string
type Server ¶
type Server struct { sync.Mutex sync.Pool // for websocket.Upgrader::WriteBufferPool // contains filtered or unexported fields }
func (*Server) AddAuthHandler ¶
func (*Server) AddConnectedHandler ¶
func (*Server) AddRawConnectionHandler ¶
func (*Server) BroadCastData ¶
func (*Server) BroadCastJSON ¶
func (*Server) BroadCastString ¶
func (*Server) GetConnByID ¶
func (*Server) Upgrade ¶
func (this *Server) Upgrade(w http.ResponseWriter, r *http.Request, args ...interface{})
func (*Server) UpgradeWithValues ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.