https://github.com/sharadbhat/readable-random
Go package for generating readable random phrases.
https://github.com/sharadbhat/readable-random
golang human-readable package random-string
Last synced: 30 days ago
JSON representation
Go package for generating readable random phrases.
- Host: GitHub
- URL: https://github.com/sharadbhat/readable-random
- Owner: sharadbhat
- License: mit
- Created: 2019-10-10T18:04:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-23T18:05:40.000Z (over 5 years ago)
- Last Synced: 2024-06-20T14:57:22.077Z (11 months ago)
- Topics: golang, human-readable, package, random-string
- Language: Go
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# readable-random
[](https://godoc.org/github.com/sharadbhat/readable-random)
[](https://goreportcard.com/report/github.com/sharadbhat/readable-random)A Go package to generate readable random phrase.
[GitHub Repository](https://github.com/sharadbhat/readable-random)
## Get started
To install,
```sh
go get github.com/sharadbhat/readable-random
```## Usage Instructions
To use the package, first import it.
```go
import readable "github.com/sharadbhat/readable-random"
```To generate a random phrase,
```go
phrase := readable.Generate() // Eg: ForgetfulEgg
```Has a method to allow for custom word count, custom separator and optional title casing.
```go
phrase := readable.GenerateSpecial(false, 4, "_") // Eg: a_purple_psychotic_animal
```Also has methods to return single adjective or noun.
```go
adjective := readable.Adjective() // Eg: absurdnoun := readable.Noun() // Eg: opinion
```## Uses
- This can be used to name and fetch user uploaded resources.
Example: `https://example.com/photos/ForgetfulEgg`
- Container names.
For best results, use a word count value of 2, 3, 4, or 5.