chatserver

package module
v0.0.0-...-5e3e7e7 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentType    = "Content-Type"
	DefaultPortNum = "8080"
	MimeTypeJSON   = "application/json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp() *App

func (*App) HealthHandler

func (a *App) HealthHandler(w http.ResponseWriter, r *http.Request)

func (*App) Init

func (a *App) Init(portNum string) error

func (*App) Run

func (a *App) Run() error

type Clients

type Clients struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClients

func NewClients() *Clients

func (*Clients) Add

func (c *Clients) Add(conn *websocket.Conn)

func (*Clients) Broadcast

func (c *Clients) Broadcast(msg Message)

func (*Clients) Delete

func (c *Clients) Delete(conn *websocket.Conn)

type Message

type Message struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Message  string `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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