Skip to content
This repository has been archived by the owner on Nov 14, 2020. It is now read-only.

manhtai/golang-mongodb-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A toy chat app

Overview

The app contains 2 parts:

  • Persistent structs: User, Channel, Message

These models holds information about User, Channel & Message from channels when user send messages, data is saved to Mongodb.

  • Websocket structs: Client, Room

These are responsible for opening Websocket connection to receive message from user & broadcast it to all client in a specific channel.

Get started

go get github.com/manhtai/golang-mongodb-chat
dep ensure
go run main.go

SSL & Live reload support

go get github.com/codegangsta/gin
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout key.pem -out cert.pem
gin --certFile cert.pem --keyFile key.pem --all main.go

Releases

No releases published

Packages

No packages published