func (r *Report) Validate(col *bongo.Collection) []error { _, err := valid.ValidateStruct(r) errs := util.ConvertGovalidatorErrors(err) if r.Type != REQUEST && r.Type != COMPLAIN { errs = append(errs, errors.New("Type: invalid type of report")) } return errs }
func (u *User) Validate(col *bongo.Collection) []error { _, errs := valid.ValidateStruct(u) return util.ConvertGovalidatorErrors(errs) }