-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidatorWrapped.go
More file actions
98 lines (83 loc) · 5.1 KB
/
validatorWrapped.go
File metadata and controls
98 lines (83 loc) · 5.1 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package validator
import (
"net/http"
"github.com/siherrmann/validator/model"
)
// Validate is the wrapper function for the Validate method of the Validator struct.
// More details can be found in the Validate method.
func Validate(v any, tagType ...string) error {
r := NewValidator()
return r.Validate(v, tagType...)
}
// ValidateWithValidation is the wrapper function for the ValidateWithValidation method of the Validator struct.
// More details can be found in the ValidateWithValidation method.
func ValidateWithValidation(jsonInput map[string]any, validations []model.Validation) (map[string]any, error) {
r := NewValidator()
return r.ValidateWithValidation(jsonInput, validations)
}
// ValidateAndUpdate is the wrapper function for the ValidateAndUpdate method of the Validator struct.
// More details can be found in the ValidateAndUpdate method.
func ValidateAndUpdate(jsonInput map[string]any, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.ValidateAndUpdate(jsonInput, structToUpdate, tagType...)
}
// ValidateAndUpdateWithValidation is the wrapper function for the ValidateAndUpdateWithValidation method of the Validator struct.
// More details can be found in the ValidateAndUpdateWithValidation method.
func ValidateAndUpdateWithValidation(jsonInput map[string]any, mapToUpdate *map[string]any, validations []model.Validation) error {
r := NewValidator()
return r.ValidateAndUpdateWithValidation(jsonInput, mapToUpdate, validations)
}
// UnmapOrUnmarshalAndValidate is the wrapper function for the UnmapOrUnmarshalAndValidate method of the Validator struct.
// More details can be found in the UnmapOrUnmarshalAndValidate method.
func UnmapOrUnmarshalAndValidate(request *http.Request, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.UnmapOrUnmarshalAndValidate(request, structToUpdate, tagType...)
}
// UnmapAndValidate is the wrapper function for the UnmapAndValidate method of the Validator struct.
// More details can be found in the UnmapAndValidate method.
func UnmapAndValidate(request *http.Request, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.UnmapAndValidate(request, structToUpdate, tagType...)
}
// UnmarshalAndValidate is the wrapper function for the UnmarshalAndValidate method of the Validator struct.
// More details can be found in the UnmarshalAndValidate method.
func UnmarshalAndValidate(request *http.Request, v any, tagType ...string) error {
r := NewValidator()
return r.UnmarshalAndValidate(request, v, tagType...)
}
// UnmapOrUnmarshalValidateAndUpdate is the wrapper function for the UnmapOrUnmarshalValidateAndUpdate method of the Validator struct.
// More details can be found in the UnmapOrUnmarshalValidateAndUpdate method.
func UnmapOrUnmarshalValidateAndUpdate(request *http.Request, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.UnmapOrUnmarshalValidateAndUpdate(request, structToUpdate, tagType...)
}
// UnmapValidateAndUpdate is the wrapper function for the UnmapValidateAndUpdate method of the Validator struct.
// More details can be found in the UnmapValidateAndUpdate method.
func UnmapValidateAndUpdate(request *http.Request, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.UnmapValidateAndUpdate(request, structToUpdate, tagType...)
}
// UnmarshalValidateAndUpdate is the wrapper function for the UnmarshalValidateAndUpdate method of the Validator struct.
// More details can be found in the UnmarshalValidateAndUpdate method.
func UnmarshalValidateAndUpdate(request *http.Request, structToUpdate any, tagType ...string) error {
r := NewValidator()
return r.UnmarshalValidateAndUpdate(request, structToUpdate, tagType...)
}
// UnmapOrUnmarshalValidateAndUpdateWithValidation is the wrapper function for the UnmapOrUnmarshalValidateAndUpdateWithValidation method of the Validator struct.
// More details can be found in the UnmapOrUnmarshalValidateAndUpdateWithValidation method.
func UnmapOrUnmarshalValidateAndUpdateWithValidation(request *http.Request, mapToUpdate *map[string]any, validations []model.Validation) error {
r := NewValidator()
return r.UnmapOrUnmarshalValidateAndUpdateWithValidation(request, mapToUpdate, validations)
}
// UnmapValidateAndUpdateWithValidation is the wrapper function for the UnmapValidateAndUpdateWithValidation method of the Validator struct.
// More details can be found in the UnmapValidateAndUpdateWithValidation method.
func UnmapValidateAndUpdateWithValidation(request *http.Request, mapToUpdate *map[string]any, validations []model.Validation) error {
r := NewValidator()
return r.UnmapValidateAndUpdateWithValidation(request, mapToUpdate, validations)
}
// UnmarshalValidateAndUpdateWithValidation is the wrapper function for the UnmarshalValidateAndUpdateWithValidation method of the Validator struct.
// More details can be found in the UnmarshalValidateAndUpdateWithValidation method.
func UnmarshalValidateAndUpdateWithValidation(request *http.Request, mapToUpdate *map[string]any, validations []model.Validation) error {
r := NewValidator()
return r.UnmarshalValidateAndUpdateWithValidation(request, mapToUpdate, validations)
}