server

package module
v0.0.0-...-94e4fcb Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChatRoom

func CreateChatRoom(w http.ResponseWriter, r *http.Request)

func Index

func Index(w http.ResponseWriter, _ *http.Request)

func JoinChatRoom

func JoinChatRoom(w http.ResponseWriter, r *http.Request)

func ServeWs

func ServeWs(chatRoom *ChatRoom, w http.ResponseWriter, r *http.Request)

func ServerAlive

func ServerAlive(w http.ResponseWriter, r *http.Request)

func ShowChat

func ShowChat(w http.ResponseWriter, r *http.Request)

Types

type ChatRoom

type ChatRoom struct {
	Users map[*Client]bool

	Id int
	// contains filtered or unexported fields
}

func NewChatRoom

func NewChatRoom() *ChatRoom

func (*ChatRoom) Run

func (cr *ChatRoom) Run()

type Client

type Client struct {
	// contains filtered or unexported fields
}

type Message

type Message struct {
	Body string `json:"body"`
	Time int    `json:"time"`
}

Jump to

Keyboard shortcuts

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