-
Notifications
You must be signed in to change notification settings - Fork 18
/
port.go
64 lines (59 loc) · 1.24 KB
/
port.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 cmd
import (
"strings"
)
//go:generate stringer -type=port
type port uint16
const (
// Daytime of the night
Daytime port = 13
// FTP protocol port number
FTP port = 21
// SSH protocol port number
SSH port = 22
// Telnet protocol port number
Telnet port = 23
// SMTP protocol port number
SMTP port = 25
// Time protocol port number
Time port = 37
// Whois protocol port number
Whois port = 43
// DNS protocol port number
DNS port = 53
// TFTP protocol port number
TFTP port = 69
// Gopher protocol port number
Gopher port = 70
// HTTP protocol port number
HTTP port = 80
// Kerberos protocol port number
Kerberos port = 88
// Nic protocol port number
Nic port = 101
// SFTP protocol port number
SFTP port = 115
// NTP protocol port number
NTP port = 123
// IMAP protocol port number
IMAP port = 143
// SNMP protocol port number
SNMP port = 161
// IRC protocol port number
IRC port = 194
// HTTPS protocol port number
HTTPS port = 443
// Docker protocol port number
Docker port = 2376
// RDP protocol port number
RDP port = 3389
// Minecraft protocol port number
Minecraft port = 25565
)
func (i port) StringFormatted() string {
res := i.String()
if strings.HasPrefix(res, "port(") {
return ""
}
return res
}