MCPcopy
hub / github.com/go-playground/validator / RegisterStructValidation

Method RegisterStructValidation

validator_instance.go:254–256  ·  view source on GitHub ↗

RegisterStructValidation registers a StructLevelFunc against a number of types. NOTE: - this method is not thread-safe it is intended that these all be registered prior to any validation

(fn StructLevelFunc, types ...interface{})

Source from the content-addressed store, hash-verified

252// NOTE:
253// - this method is not thread-safe it is intended that these all be registered prior to any validation
254func (v *Validate) RegisterStructValidation(fn StructLevelFunc, types ...interface{}) {
255 v.RegisterStructValidationCtx(wrapStructLevelFunc(fn), types...)
256}
257
258// RegisterStructValidationCtx registers a StructLevelFuncCtx against a number of types and allows passing
259// of contextual validation information via context.Context.

Calls 2

wrapStructLevelFuncFunction · 0.85