-
Notifications
You must be signed in to change notification settings - Fork 0
/
static.go
31 lines (29 loc) · 856 Bytes
/
static.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
package main
// cmdMap acts as a map that points ftp command inputs to their functions.
var cmdMap = map[string]func(*client){
"cwd": handleCwd,
"cdup": handleCdup,
"mode": handleMode,
"nlst": handleNlst,
"pass": handlePass,
"pasv": handlePasv,
"retr": handleRetr,
"type": handleType,
"quit": handleQuit,
"user": handleUser,
"noop": handleNoop,
}
// codeMap acts as a map that points status codes to their text outputs.
var codeMap = map[int]string{
150: "Opened data conn",
200: "Okay",
220: "Accepted Connection to FTP. Success!",
226: "Data successfully sent",
230: "Already logged in",
331: "FTP Server is Anonymous need PASS",
500: "Invalid command or error",
502: "Not implemented",
504: "Command not implemented to handle that parameter",
530: "Please login with USER and PASS",
550: "Requested action is uncompleteable",
}