Documentation
¶
Overview ¶
Package validationrule describes validation rules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutomaticallyNamed ¶
type AutomaticallyNamed struct{}
AutomaticallyNamed can be embedded into a rule struct to indicate that the rule does not require its name to be manually specified because it is automatically generated from other data in the rule.
func (AutomaticallyNamed) RequiresName ¶
func (AutomaticallyNamed) RequiresName() bool
RequiresName returns false.
func (AutomaticallyNamed) SetName ¶
func (AutomaticallyNamed) SetName(string)
SetName is a no-op because the rule does not support manually specifying its name.
type Interface ¶
type Interface interface { // Name returns the name of the rule. Name() string // SetName sets the name of the rule if it is a rule that requires manually specifying its name. // This should be a no-op for rules that automatically generate their name. SetName(string) // RequiresName returns whether the validation rule requires its name to be manually specified. // This should return false for rules that automatically generate their name. RequiresName() bool }
Interface defines validation rule behavior.
type ManuallyNamed ¶
type ManuallyNamed struct{}
ManuallyNamed can be embedded into a rule struct to indicate that the rule requires its name to be manually specified.
func (ManuallyNamed) RequiresName ¶
func (ManuallyNamed) RequiresName() bool
RequiresName returns true.
Click to show internal directories.
Click to hide internal directories.