github.com/zhongdalu/gf@v1.0.0/g/net/ghttp/ghttp_server_websocket.go (about)

     1  // Copyright 2018 gf Author(https://github.com/zhongdalu/gf). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/zhongdalu/gf.
     6  
     7  package ghttp
     8  
     9  import "github.com/zhongdalu/gf/third/github.com/gorilla/websocket"
    10  
    11  type WebSocket struct {
    12  	*websocket.Conn
    13  }
    14  
    15  const (
    16  	// TextMessage denotes a text data message. The text message payload is
    17  	// interpreted as UTF-8 encoded text data.
    18  	WS_MSG_TEXT = websocket.TextMessage
    19  
    20  	// BinaryMessage denotes a binary data message.
    21  	WS_MSG_BINARY = websocket.BinaryMessage
    22  
    23  	// CloseMessage denotes a close control message. The optional message
    24  	// payload contains a numeric code and text. Use the FormatCloseMessage
    25  	// function to format a close message payload.
    26  	WS_MSG_CLOSE = websocket.CloseMessage
    27  
    28  	// PingMessage denotes a ping control message. The optional message payload
    29  	// is UTF-8 encoded text.
    30  	WS_MSG_PING = websocket.PingMessage
    31  
    32  	// PongMessage denotes a pong control message. The optional message payload
    33  	// is UTF-8 encoded text.
    34  	WS_MSG_PONG = websocket.PongMessage
    35  )