-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add chatroom folder structure and description
- Add chatroom folder struct #17
- Loading branch information
Showing
4 changed files
with
106 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,57 @@ | ||
## ChartRoom | ||
# ChartRoom | ||
|
||
- 主要功能 | ||
聊天室在线人数、在线列表 | ||
昵称、头像设置 | ||
发送/接收消息 | ||
进入、退出聊天室 | ||
不同消息类型的支持:文字、表情、图片、语音、视频等 | ||
敏感词过滤 | ||
黑名单/禁言 | ||
聊天室信息 | ||
创建、修改聊天室 | ||
聊天室信息存储和历史消息查询 | ||
... | ||
|
||
## 基于tcp的聊天室 | ||
|
||
- 如果大量用户广播延迟问题 | ||
- 消息的堵塞 | ||
|
||
## 目录 | ||
|
||
- tcp 实现了tcp版本的wesocket | ||
- webscocket 使用不同的库,性能上对比,似乎gobwas 是比较优于其他 | ||
- chatroom 是完整版本的main | ||
- logic 存放核心业务逻辑和service 目录类似 | ||
- server 存放server相关代码,类似于存放controller 的代码 | ||
- template 存放静态代码文件 | ||
|
||
```md | ||
├── chatroom | ||
│ ├── client | ||
│ │ ├── client.go | ||
│ │ └── client_test.go | ||
│ ├── server | ||
│ │ ├── server.go | ||
│ │ └── server_test.go | ||
│ └── README.md | ||
. | ||
├── README.md | ||
├── cmd | ||
│ ├── gateway | ||
│ ├── multiple | ||
│ └── rpc | ||
├── configs | ||
│ └── config.yaml | ||
├── docker | ||
├── docs | ||
├── global | ||
├── go.mod | ||
├── go.sum | ||
├── internal | ||
│ ├── dao | ||
│ ├── middleware | ||
│ ├── model | ||
│ ├── routers | ||
│ ├── service | ||
│ └── chatroom | ||
│ ├── client | ||
│ │ ├── client.go | ||
│ │ └── client_test.go | ||
│ ├── server | ||
│ │ ├── server.go | ||
│ │ └── server_test.go | ||
│ └── README.md | ||
├── main.go | ||
├── pkg | ||
│ ├── app | ||
│ ├── blog_api | ||
│ ├── convert | ||
│ ├── errcode | ||
│ ├── limiter | ||
│ ├── logger | ||
│ ├── metatext | ||
│ ├── setting | ||
│ ├── swagger | ||
│ ├── tracer | ||
│ ├── upload | ||
│ └── util | ||
├── proto | ||
├── queue.md | ||
├── scripts | ||
│ ├── chatroom | ||
│ ├── tcp | ||
│ │ ├── client | ||
│ │ │ ├── client.go | ||
│ │ │ └── client_test.go | ||
│ │ └── server | ||
│ │ ├── server.go | ||
│ │ └── server_test.go | ||
│ └── websocket | ||
│ ├── gobwas | ||
│ │ ├── client | ||
│ │ │ ├── clinet.go | ||
│ │ │ └── clinet_test.go | ||
│ │ └── server | ||
│ │ └── server.go | ||
│ └── nhooyr | ||
│ ├── client | ||
│ │ └── client.go | ||
│ └── server | ||
│ └── server.go | ||
├── logic | ||
├── server | ||
├── storage | ||
└── third_party | ||
|
||
└── template | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
|
||
"github.com/lc-1010/OneBlogService/chatroom/server" | ||
) | ||
|
||
var ( | ||
addr = ":2023" | ||
banner = ` | ||
: o o ; | ||
: \_'/ | ||
'_|__|_' | ||
/_____\ | ||
||||||| | ||
_'' ' ' ''_ | ||
_.-'_:______/:_'-._ | ||
_..-' [______/] '-.._ | ||
_-' [ ] '-_ | ||
_.=' [#] [#] '=._ | ||
[#] [#] | ||
| | | ||
\ / | ||
\ \__/\__/ / | ||
'-._|##|##|_.-' | ||
|##|##| | ||
_/##|##|\_ | ||
/____/|__|\ | ||
| /___\|##| | ||
|| \#|##/ || | ||
||| \#/ ||| | ||
` | ||
) | ||
|
||
func main() { | ||
|
||
fmt.Printf(banner+"\n", addr) | ||
server.RegisterHandle() | ||
log.Fatal(http.ListenAndServe(addr, nil)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package main | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func Test_main(t *testing.T) { | ||
//testgoog() | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package server | ||
|
||
func RegisterHandle() { | ||
|
||
} |