admin page updates
This commit is contained in:
@@ -21,10 +21,13 @@ type ValidationRule struct {
|
||||
// Getter abstracts getting values from either form or query
|
||||
type Getter interface {
|
||||
Get(key string) string
|
||||
GetList(key string) []string
|
||||
AddCheck(check *ValidationRule)
|
||||
String(key string) *StringField
|
||||
Int(key string) *IntField
|
||||
Time(key string, format *timefmt.Format) *TimeField
|
||||
StringList(key string) *StringList
|
||||
IntList(key string) *IntList
|
||||
ValidateChecks() []*ValidationRule
|
||||
Validate() bool
|
||||
ValidateAndNotify(s *hws.Server, w http.ResponseWriter, r *http.Request) bool
|
||||
@@ -32,14 +35,14 @@ type Getter interface {
|
||||
|
||||
getChecks() []*ValidationRule
|
||||
}
|
||||
type Field struct {
|
||||
type FieldBase struct {
|
||||
Key string
|
||||
optional bool
|
||||
getter Getter
|
||||
}
|
||||
|
||||
func newField(key string, g Getter) Field {
|
||||
return Field{
|
||||
func newField(key string, g Getter) FieldBase {
|
||||
return FieldBase{
|
||||
Key: key,
|
||||
getter: g,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user