namegen

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 3 Imported by: 0

README

license Go Reference Go Report Card Coverage Status

namegen

Funny name generator based on docker namesgenerator

About

Package namegen is a name generator util for golang that generates funny names like hungry_chaplygin

Usage

package main

import (
	"fmt"
	"math/rand"
	"time"

	"github.com/rb-go/namegen"
)

func main() {
	rand.Seed(time.Now().UnixNano())
	fmt.Println(namegen.GetName(0))
}

Use binary command

You can install binary with namegen name to get names in command line

Example:

namegen -retries=1

or just call namegen binary to get new name.

if retries flag is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g 'focused_turing3'

if golang installed
go install github.com/rb-go/namegen/cmd/namegen@latest
from binary releases

todo

Credits

  • Based on moby/moby namesgenerator source code

Documentation

Overview

Package namegen generates random names.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(retry int) string

GetName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`

func GetNameWithSeed

func GetNameWithSeed(r *rand.Rand, retry int) string

GetNameWithSeed generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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