goherokuname

package module
v0.0.0-...-d4c3f53 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

README

goherokuname

Go

Heroku-like Random Names in Go

To install use:

go get -f -u cirello.io/goherokuname/...

See documentation at http://godoc.org/cirello.io/goherokuname.

Documentation

Overview

Package goherokuname generates Heroku-like random names. Such as "black-block-0231".

It supports both decimal and hexadecimal suffixes. It supports customized rendering, in which the delimiter, the length of suffix and the acceptable characters for suffix are tweakable.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Haikunate

func Haikunate() string

Haikunate generate standard Heroku-like random name, with "-" as delimiter, decimal with 4 digits.

Example
package main

import (
	"fmt"

	"cirello.io/goherokuname"
)

func main() {
	fmt.Println(goherokuname.Haikunate())
}
Output:

dawn-pond-0223

func HaikunateCustom

func HaikunateCustom(delimiter string, toklen int, tokchars string) string

HaikunateCustom generates a Heroku-like random name in which the delimiter, length and acceptable characters for suffix are tweakable.

Example
package main

import (
	"fmt"

	"cirello.io/goherokuname"
)

func main() {
	fmt.Println(goherokuname.HaikunateCustom("+", 5, "abcd"))
}
Output:

tiny+limit+ddadc

func HaikunateHex

func HaikunateHex() string

HaikunateHex generate standard Heroku-like random name, with "-" as delimiter, hexadecimal with 4 digits.

Example
package main

import (
	"fmt"

	"cirello.io/goherokuname"
)

func main() {
	fmt.Println(goherokuname.HaikunateHex())
}
Output:

delicate-dawn-9869

func Ubuntu

func Ubuntu(delimiter, letter string) (string, error)

Ubuntu generates a Ubuntu-like random name in which the delimiter is tweakable.

Example
package main

import (
	"fmt"

	"cirello.io/goherokuname"
)

func main() {
	out, _ := goherokuname.Ubuntu("-", "d")
	fmt.Println(out)
}
Output:

dawn-dawn

Types

This section is empty.

Directories

Path Synopsis
Comand herokuname runs the goherokuname package in CLI.
Comand herokuname runs the goherokuname package in CLI.

Jump to

Keyboard shortcuts

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