gopredictivenamegenerator

package module
v0.0.0-...-044aaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

README

go-predictive-name-generator

Based on the work from the docker name generator (https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) this package uses a seed to determine the name making it predictive and repeatable.

Usage

import (
    "fmt"
    namegen "gitea.smoothnet.org/nhyatt/go-predictive-name-generator"
)

func main() {
    n := namegen.New()

    fmt.Printf("GeneratedName: %s\n", n.GetRandom())
    fmt.Printf("GeneratedName: %s\n", n.GetPredictive("this is a seed string"))
}

Documentation

Overview

Package gopredictivenamegenerator generates random or predictive names.

This package is based on the moby namesgenerator package found here: https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NameGenerator

type NameGenerator struct {
	// contains filtered or unexported fields
}

func New

func New() NameGenerator

func (*NameGenerator) GetPredictive

func (n *NameGenerator) GetPredictive(seedString string) string

GetPredictive gselects a name based off a predetermined seed from the list of adjectives and surnames in this package formatted as "adjective-surname". For example 'focused-turing'.

func (*NameGenerator) GetRandom

func (n *NameGenerator) GetRandom() string

GetRandom generates a random name from the list of adjectives and surnames in this package formatted as "adjective-surname". For example 'focused-turing'.

Jump to

Keyboard shortcuts

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