Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithLegacySupport ¶
func WithLegacySupport(mode Mode) pv.ValidatorOption
WithLegacySupport provides a protovalidate.ValidatorOption that transparently upgrades legacy constraints defined for protoc-gen-validate to be compatible with protovalidate. The specified mode determines the behavior of how the validator uses the legacy constraints.
Types ¶
type Mode ¶
type Mode uint8
Mode determines the behavior of how the validator uses the legacy constraints relative to existing standard constraints.
const ( // ModeMerge merges any existing standard constraints into the translated // legacy constraints. This mode uses proto.Merge to combine the results. This // is the default behavior. ModeMerge Mode = iota // ModeReplace replaces all existing standard constraints on the message, // oneof, or field with the translated legacy constraints. ModeReplace // ModeIfNotPresent uses the translated legacy constraints only if no standard // constraints are present on the message, oneof, or field. ModeIfNotPresent )
Click to show internal directories.
Click to hide internal directories.