Index | Files

package name

import ""

Package 'name' contains contracts and functionality to help with naming things.


Package Files

basic.go length.go name.go regexp.go

type Formatter Uses

type Formatter interface {
    FormatName(name string) (string, error)

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 Processor Uses

type Processor interface {

Processor is a Validator and Formatter.

type RuneLevelProcessor Uses

type RuneLevelProcessor interface {

RuneLevelProcessor is a RuneLevelValidator and Formatter.

type RuneLevelValidator Uses

type RuneLevelValidator interface {
    IsRuneValid(r rune) bool

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 Uses

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 Uses

type Validator interface {
    IsValid(name string) bool

Validator is an interface which declares operations associated with name validation.

IsValid returns true if the provided name is valid.

func NewLengthValidator Uses

func NewLengthValidator(min uint, max uint) Validator

NewLengthValidator constructs a Validator which can verify that names are of a correct length

func NewRegexpValidator Uses

func NewRegexpValidator(validPattern string) (Validator, error)

NewRegexpValidator constructs a new Validator which verifies that a name matches a specific regular expression

Package name imports 2 packages (graph) and is imported by 3 packages. Updated 2020-02-10. Refresh now. Tools for package owners.