Documentation ¶
Overview ¶
Package 'name' contains contracts and functionality to help with naming things.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
Formatter is an interface which defines operations for types which can format names.
FormatName takes a name, formats it and then returns the result.
type RuneLevelProcessor ¶
type RuneLevelProcessor interface { RuneLevelValidator Formatter }
RuneLevelProcessor is a RuneLevelValidator and Formatter.
type RuneLevelValidator ¶
RuneLevelValidator is Validator which can also validate isolated runes within a name.
IsRuneValid returns true if the provided rune is a valid component of a name
func NewBasicValidator ¶
func NewBasicValidator(isEmptyValid bool, isValidRuneCheck func(rune) bool) (RuneLevelValidator, error)
NewBasicValidator constructs a RuneLevelValidator which can validate names for being empty or containing isolated runes which fail a basic validation check
type Validator ¶
Validator is an interface which declares operations associated with name validation.
IsValid returns true if the provided name is valid.
func NewLengthValidator ¶
NewLengthValidator constructs a Validator which can verify that names are of a correct length
func NewRegexpValidator ¶
NewRegexpValidator constructs a new Validator which verifies that a name matches a specific regular expression