-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathforms.go
More file actions
35 lines (31 loc) · 790 Bytes
/
Copy pathforms.go
File metadata and controls
35 lines (31 loc) · 790 Bytes
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
package captive
import (
"github.com/MartinBrugnara/goforms/fields"
"github.com/MartinBrugnara/goforms/forms"
)
const (
MAC_STD_REGEXP = "([0-9A-Fa-f]{2}:{5,7})[0-9A-Fa-f]{2}"
IP_REGEXP = "([0-9]{1,3}\\.){3}[0-9]{1,3}"
USER_REGEXP = "[a-Z0-9\\.]{2,}"
PASSWORD_REGEXP = "[a-Z0-9]{8}"
)
var (
FFLogin = forms.FormFields{
"mac": fields.NewRegexField(fields.Defaults{
"Required": true,
"MatchString": MAC_STD_REGEXP,
}),
"ip": fields.NewRegexField(fields.Defaults{
"Required": true,
"MatchString": IP_REGEXP,
}),
"username": fields.NewRegexField(fields.Defaults{
"Required": true,
"MatchString": USER_REGEXP,
}),
"password": fields.NewRegexField(fields.Defaults{
"Required": true,
"MatchString": PASSWORD_REGEXP,
}),
}
)