random_project_generator

package module
v0.0.0-...-8d7524d Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2016 License: ISC, MIT Imports: 5 Imported by: 0

README

Random project name generator

This is a random project name generator, written in Go. There are many libraries for this task, but most only reproduce the same list of 50 adjectives and 50 words from this gist. This means there are only 2500 combinations, and you're sharing with every other project using those lists. Other Go libraries store the list in a JSON file, which means end users need to figure out how to find/load the JSON file at runtime.

This project exposes the project-name-generator list, which is much more extensive - 1300 adjectives and 870 nouns means there are over a million possible combinations.

Usage:

package main

import (
    "github.com/kevinburke/go-random-project-generator"
    "fmt"
)

func main() {
    name := random_project_generator.Generate()
    fmt.Println(name) // "tidy-boat"
    name = random_project_generator.GenerateNumber(4)
    fmt.Println(name) // "viable-action-2183"
}

You can bring your own list as well, overwrite random_project_generator.Nouns or random_project_generator.Adjectives in your init function.

Documentation

Overview

Package random_project_generator generates random project names.

Random names are generated by selecting a random adjective from a list of 1300 adjectives, and a random noun from a list of 870 nouns, giving you over a million possible combinations.

Index

Examples

Constants

This section is empty.

Variables

View Source
var Adjectives = []string{}/* 1240 elements not displayed */

Array of adjectives, in alphabetical order, between 3 and 10 letters long.

View Source
var Nouns = []string{}/* 838 elements not displayed */

Array of nouns, in alphabetical order, between 3 and 10 letters long.

Functions

func Generate

func Generate() string

Generate finds a random adjective and a random noun and joins them with a hyphen.

Example
// Will print words like "smiling-fold"
fmt.Println(Generate())
Output:

func GenerateNumber

func GenerateNumber(d int) string

GenerateNumber returns a string with an adjective, a noun, and a number with d digits, joined together by hyphens. Each additional digit adds a factor of 9 to the number of possible results that can be generated, so 4 digits will yield roughly 7420491000 different possibilities.

Example
// Will print a string like "viable-action-218"
fmt.Println(GenerateNumber(3))
Output:

func Valid

func Valid(s string) bool

Valid returns true if s could have been generated by this library.

Types

This section is empty.

Jump to

Keyboard shortcuts

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