diff --git a/email.go b/email.go index 7097825..052981e 100644 --- a/email.go +++ b/email.go @@ -134,12 +134,12 @@ func SendEmail(email *Email, conf *EmailConfig) error { } type EmailConfig struct { - ServerName string - Identity string - Username string - Password string - Host string - Port int + ServerName string `json:"-"` + Identity string `json:"-"` + Username string `json:"username"` + Password string `json:"password"` + Host string `json:"host"` + Port int `json:"port"` } func NewEmailConfig(ident, uname, pword, host string, port int) *EmailConfig { diff --git a/filtering.go b/filtering.go index 8ad95ac..ab86f30 100644 --- a/filtering.go +++ b/filtering.go @@ -8,6 +8,14 @@ import ( type Filter map[string]string +func (f *Filter) Size() int { + return len(*f) +} + +func (f *Filter) Valid() bool { + return len(*f) > 0 +} + func (fs Filter) validate(validFilters []string) (Filter, bool) { goodFilters := make(map[string]string) cnt := 0