websocket

package
v0.0.0-...-9b15d4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MESSAGE_TYPE_COUNTRY = "COUNTRY"
	MESSAGE_TYPE_CONTEXT = "CONTEXT"
	MESSAGE_TYPE_CHAT    = "CHAT"
)

Variables

This section is empty.

Functions

func Upgrade

func Upgrade(w http.ResponseWriter, r *http.Request) (*websocket.Conn, error)

Types

type Client

type Client struct {
	ID   string
	Conn *websocket.Conn
}

func (*Client) Read

func (c *Client) Read(contentService models.ContentService)

type Message

type Message struct {
	Sender string      `json:"sender"`
	Type   int         `json:"type"`
	Body   MessageBody `json:"body"`
}

type MessageBody

type MessageBody struct {
	Content     string `json:"content"`
	ContentType string `json:"contentType"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL