Documentation
¶
Index ¶
- Constants
- func AESCBCEncrypt(plainText []byte, signalingKey string) (encryptPlainText []byte, err error)
- func AuthorizationHeader(key string, c echo.Context) (ok bool, err error)
- func BytesCombine(pBytes ...[]byte) []byte
- func BytesToInt(b []byte) int64
- func GenerateAttachmentId() (int64, error)
- func GenerateHMAC(message, key []byte) []byte
- func HeaderParams(c echo.Context) (hs *headerSort, checkSignStr string)
- func IntToBytes(n int64) []byte
- func IsValidNumber(phone string) bool
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func SignAuth(c echo.Context) (check bool, err error)
- type Client
- type Hub
- type SingleMessage
Constants ¶
View Source
const ( // Send pings to peer with this period. Must be less than pongWait. PingPeriod = (pongWait * 9) / 10 // Maximum message size allowed from peer. MaxMessageSize = 1024 )
View Source
const Secret = "xxf223"
Variables ¶
This section is empty.
Functions ¶
func AESCBCEncrypt ¶
func AuthorizationHeader ¶
func BytesCombine ¶
func GenerateHMAC ¶
func HeaderParams ¶
func PKCS5Padding ¶
Types ¶
type Hub ¶
type Hub struct { // Registered clients. Clients map[*Client]bool // Inbound messages from the clients. Broadcast chan []byte // Register requests from the clients. Register chan *Client // Unregister requests from clients. Unregister chan *Client // Unregister requests from clients. SendSingle chan *SingleMessage }
hub maintains the set of active clients and broadcasts messages to the clients.
type SingleMessage ¶
Click to show internal directories.
Click to hide internal directories.