Back to / name

Package name

Latest Go to latest

The latest major version is .

Published: Jun 18, 2020 | License: MIT | Module:


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


type Formatter

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

type Processor interface {

Processor is a Validator and Formatter.

type RuneLevelProcessor

type RuneLevelProcessor interface {

RuneLevelProcessor is a RuneLevelValidator and Formatter.

type RuneLevelValidator

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

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

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

func NewLengthValidator(min uint, max uint) Validator

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

func NewRegexpValidator

func NewRegexpValidator(validPattern string) (Validator, error)

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier