-
Notifications
You must be signed in to change notification settings - Fork 0
/
structs.go
64 lines (56 loc) · 1.09 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package main
import (
"github.com/gliderlabs/ssh"
"golang.org/x/crypto/ssh/terminal"
)
type Message struct {
Msg string
From string
}
type User struct {
Session ssh.Session
Terminal *terminal.Terminal
Room *Room
Color string
}
type Room struct {
Name string
History []Message
Users []*User
}
// ANSI 颜色码
var Colors = []string{
"\033[31m", // 红色
"\033[32m", // 绿色
"\033[33m", // 黄色
"\033[34m", // 蓝色
"\033[35m", // 紫色
"\033[36m", // 青色
}
// 支持的命令
var commands = map[string]string{
Help: "显示帮助信息",
Color: "切换颜色",
Nick: "修改昵称",
History: "查看历史消息",
Users: "查询在线用户",
Rooms: "查询房间列表",
Enter: "进入房间",
Leave: "离开房间",
}
const (
Help string = "help"
Color string = "color"
Nick string = "nick"
History string = "history"
Users string = "users"
Rooms string = "rooms"
Enter string = "enter"
Leave string = "leave"
)
// 频道名称
const (
Default string = "default"
Tech string = "tech"
Music string = "music"
)