Documentation ¶
Index ¶
- func NewClient(id, name string, opts ClientOptions) him.Client
- func NewServer(listen string, service him.ServiceRegistration) him.Server
- type Client
- func (c *Client) Close()
- func (c *Client) Connect(addr string) error
- func (c *Client) GetMeta() map[string]string
- func (c *Client) ID() string
- func (c *Client) Name() string
- func (c *Client) Read() (him.Frame, error)
- func (c *Client) Send(payload []byte) error
- func (c *Client) ServiceID() string
- func (c *Client) ServiceName() string
- func (c *Client) SetDialer(dialer him.Dialer)
- type ClientOptions
- type Frame
- type Server
- func (s *Server) Push(id string, data []byte) error
- func (s *Server) SetAcceptor(acceptor him.Acceptor)
- func (s *Server) SetChannelMap(channelMap him.ChannelMap)
- func (s *Server) SetMessageListener(listener him.MessageListener)
- func (s *Server) SetReadWait(readWait time.Duration)
- func (s *Server) SetStateListener(listener him.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 Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame Frame 帧处理 对ws.Frame包装, 实现了him.Frame接口
func (*Frame) GetPayload ¶
func (*Frame) SetPayload ¶
type Server ¶
type Server struct { him.ServiceRegistration him.ChannelMap him.Acceptor him.MessageListener him.StateListener // contains filtered or unexported fields }
Server is a websocket implement of the Server interface
func (*Server) SetAcceptor ¶
func (*Server) SetChannelMap ¶
func (s *Server) SetChannelMap(channelMap him.ChannelMap)
func (*Server) SetMessageListener ¶
func (s *Server) SetMessageListener(listener him.MessageListener)
func (*Server) SetReadWait ¶
func (*Server) SetStateListener ¶
func (s *Server) SetStateListener(listener him.StateListener)
type ServerOptions ¶
type ServerOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.