Documentation ¶
Index ¶
- Variables
- func ClientIp(r *http.Request) string
- func Handler(ctx context.Context, origin bool, heartbeatInterval int64, ...) func(w http.ResponseWriter, r *http.Request)
- type Connection
- func (c *Connection) Close()
- func (c *Connection) HeartbeatChecker()
- func (c *Connection) IsAlive() bool
- func (c *Connection) KeepAlive()
- func (c *Connection) ReadMessage() ([]byte, error)
- func (c *Connection) RemoteAddr() net.Addr
- func (c *Connection) RemoteRealIP() string
- func (c *Connection) WriteMessage(data []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnectionClosed = errors.New("connection is closed") ErrClientConnClosed = errors.New("client connection is closed") )
Functions ¶
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) HeartbeatChecker ¶
func (c *Connection) HeartbeatChecker()
func (*Connection) IsAlive ¶
func (c *Connection) IsAlive() bool
func (*Connection) KeepAlive ¶
func (c *Connection) KeepAlive()
func (*Connection) ReadMessage ¶
func (c *Connection) ReadMessage() ([]byte, error)
func (*Connection) RemoteAddr ¶
func (c *Connection) RemoteAddr() net.Addr
func (*Connection) RemoteRealIP ¶
func (c *Connection) RemoteRealIP() string
func (*Connection) WriteMessage ¶
func (c *Connection) WriteMessage(data []byte) error
Click to show internal directories.
Click to hide internal directories.