MCPcopy Create free account
hub / github.com/go-playground/validator / RegisterValidationCtx

Method RegisterValidationCtx

validator_instance.go:227–233  ·  view source on GitHub ↗

RegisterValidationCtx does the same as RegisterValidation on accepts a FuncCtx validation allowing context.Context validation support.

(tag string, fn FuncCtx, callValidationEvenIfNull ...bool)

Source from the content-addressed store, hash-verified

225// RegisterValidationCtx does the same as RegisterValidation on accepts a FuncCtx validation
226// allowing context.Context validation support.
227func (v *Validate) RegisterValidationCtx(tag string, fn FuncCtx, callValidationEvenIfNull ...bool) error {
228 var nilCheckable bool
229 if len(callValidationEvenIfNull) > 0 {
230 nilCheckable = callValidationEvenIfNull[0]
231 }
232 return v.registerValidation(tag, fn, false, nilCheckable)
233}
234
235// RegisterAlias registers a mapping of a single validation tag that
236// defines a common or complex set of validation(s) to simplify adding validation

Callers 3

RegisterValidationMethod · 0.95
TestAddFunctionsFunction · 0.80

Calls 1

registerValidationMethod · 0.95

Tested by 2

TestAddFunctionsFunction · 0.64