Documentation
¶
Index ¶
- func NewClient(id, name string, opts ClientOptions) goim.Client
- func NewServer(listen string, service naming.ServiceRegistration) goim.Server
- type Client
- type ClientOptions
- type Frame
- type Server
- func (s *Server) Push(id string, data []byte) error
- func (s *Server) SetAcceptor(acceptor goim.Acceptor)
- func (s *Server) SetChannelMap(channels goim.ChannelMap)
- func (s *Server) SetMessageListener(listener goim.MessageListener)
- func (s *Server) SetReadWait(readwait time.Duration)
- func (s *Server) SetStateListener(listener goim.StateListener)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) Start() error
- type ServerOptions
- type WsConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientOptions ¶
type ClientOptions struct {
ReadWait time.Duration // 读超时
WriteWait time.Duration // 写超时
Heartbeat time.Duration // 心跳超时
}
ClientOptions ClientOptions
type Server ¶
type Server struct {
naming.ServiceRegistration
goim.ChannelMap
goim.Acceptor
goim.MessageListener
goim.StateListener
// contains filtered or unexported fields
}
Server is a websocket implement of the Server
func (*Server) SetAcceptor ¶
SetAcceptor SetAcceptor
func (*Server) SetChannelMap ¶
func (s *Server) SetChannelMap(channels goim.ChannelMap)
SetChannels SetChannels
func (*Server) SetMessageListener ¶
func (s *Server) SetMessageListener(listener goim.MessageListener)
SetMessageListener SetMessageListener
func (*Server) SetReadWait ¶
SetReadWait set read wait duration
func (*Server) SetStateListener ¶
func (s *Server) SetStateListener(listener goim.StateListener)
SetStateListener SetStateListener
type ServerOptions ¶
type ServerOptions struct {
// contains filtered or unexported fields
}
ServerOptions ServerOptions
Click to show internal directories.
Click to hide internal directories.