namer

package
v1.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDescriptors

func DefaultDescriptors() []string

DefaultDescriptors returns a copy of the default descriptor list, for use with New by callers that want to substitute only the nouns.

Types

type Namer

type Namer interface {
	// Name returns a randomly generated name of the form
	// <descriptor>-<noun>.
	Name() string
}

Namer generates random, human-friendly names.

func New

func New(descriptors, nouns []string) (Namer, error)

New returns a Namer that composes names from the given descriptors and nouns. Both lists must be non-empty. The Namer keeps its own copies, so later changes to the lists passed in do not affect it.

func NewDefault

func NewDefault() Namer

NewDefault returns a Namer that composes names from the default descriptor and noun lists.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL