generator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package generator encapsulates the structure which is in charge of populating the petname array

Package generator encapsulates the structure which is in charge of populating the petname array

Index

Constants

View Source
const (
	// NameTemplate is the call value for templating
	NameTemplate = ".Name"
	// AdjectiveTemplate is the call value for templating
	AdjectiveTemplate = ".Adjective"
)

Variables

View Source
var (
	// Name is a list of default scientist names
	Name = []string{}/* 234 elements not displayed */

	// Adjective is a list of default adjectives
	Adjective = []string{}/* 108 elements not displayed */

)

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Name              string
	Used              *dict.Tree
	TemplateInterface []func() (int, string)
	Separator         rune
}

Generator encapsulates all functions that allow for the unique generation of a petname

func (*Generator) Get

func (g *Generator) Get() string

Get generates an unique petname and returns that string

func (*Generator) New

func (g *Generator) New(t string, n string, s rune)

New generates a new generator from a given template If template does not follow the const given will return empty generator

Jump to

Keyboard shortcuts

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