chat.md name: チャットルーム
sort: 1
チャットルーム
このサンプルでは、Web IMアプリケーションを実装する2つの方法を示しています:
ロングポーリングを使用しています。 WebSocketを使用しています。
どちらもデフォルトではメモリにデータを保存していますので、毎回やり直してスタートしますが、データベースを使用するためにconf/app.conf内で設定を変更することができます。
プロジェクト構造は、次のとおりです:
WebIM/WebIM.go # File of main packageconfapp.conf # Configuration filecontrollersapp.go # The welcome screen that allows user to pick a technology and usernamechatroom.go # Functions for data managementlongpolling.go # Controller and methods for long polling chat demowebsocket.go # Controller and methods for WebSocket chat demomodelsarchive.go # Functions of chat data operations for both demos.views... # Template filesstatic... # JavaScript and CSS files
