use name generator

This commit is contained in:
abhishek9686 2024-10-24 14:02:39 +04:00
parent 60ea2a76a6
commit fcf94e5652
3 changed files with 8 additions and 229 deletions

1
go.mod
View file

@ -38,6 +38,7 @@ require (
)
require (
github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e
github.com/guumaster/tablewriter v0.0.10
github.com/matryer/is v1.4.1
github.com/olekukonko/tablewriter v0.0.5

2
go.sum
View file

@ -32,6 +32,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e h1:XmA6L9IPRdUr28a+SK/oMchGgQy159wvzXA5tJ7l+40=
github.com/goombaio/namegenerator v0.0.0-20181006234301-989e774b106e/go.mod h1:AFIo+02s+12CEg8Gzz9kzhCbmbq6JcKNrhHffCGA9z4=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=

View file

@ -1,242 +1,18 @@
package models
import (
"math/rand"
"time"
"github.com/goombaio/namegenerator"
)
// NAMES - list of names 4-7 chars in length
var NAMES = []string{
"logic",
"warrant",
"iconic",
"threat",
"strike",
"boy",
"vital",
"unity",
"audio",
"schemer",
"depth",
"gravitl",
"mystic",
"donkey",
"atomic",
"turtle",
"monkey",
"rabbit",
"static",
"mosaic",
"elite",
"stonks",
"doggy",
"python",
"mohawk",
"arctic",
"rival",
"vibes",
"delay",
"bridge",
"weeble",
"combat",
"animal",
"wobble",
"rubble",
"bucket",
"proof",
"worker",
"beetle",
"racket",
"equal",
"panda",
"antics",
"strong",
"forum",
"koala",
"anchor",
"ornery",
"indigo",
"schism",
"dragon",
"knight",
"bishop",
"laser",
"rhino",
"clutch",
"shark",
"leader",
"young",
"robot",
"squish",
"chimp",
"rocket",
"space",
"queen",
"royalty",
"flush",
"earth",
"planet",
"heart",
"droplet",
"dillon",
"saturn",
"pluto",
"school",
"alien",
"matte",
"dingo",
"meercat",
"cookie",
"snack",
"goose",
"pepper",
"melissa",
"alex",
"elon",
"yeet",
"meh",
"walrus",
"avatar",
"chicken",
"proton",
"mohawk",
"tattoo",
"zebra",
"star",
"butter",
"tango",
"homie",
"rambo",
"cosmo",
"bubbles",
"hulk",
"pluto",
"scooby",
"thanos",
"yoda",
"draco",
"goofy",
"ditto",
"puff",
"duck",
"mouse",
"akita",
"water",
"hound",
"baby",
"spider",
"squid",
"roach",
"crab",
"cougar",
"cyborg",
"android",
"being",
"ninja",
"unicorn",
"zombie",
"warrior",
"zamboni",
"life",
"marine",
"node",
"mother",
"father",
"tesla",
}
// SMALL_NAMES - list of small (4 char or less) names
var SMALL_NAMES = []string{
"ace",
"odd",
"hot",
"ill",
"root",
"sudo",
"moon",
"beef",
"bro",
"dank",
"red",
"gold",
"big",
"old",
"og",
"best",
"blue",
"lil",
"mom",
"bot",
"evil",
"good",
"holy",
"rad",
"bad",
"sad",
"mad",
"chad",
"pre",
"post",
"foot",
"soft",
"hard",
"lite",
"dark",
"true",
"toy",
"soy",
"rude",
"nice",
"fun",
"fat",
"pro",
"sly",
"tan",
"pet",
"fine",
"main",
"last",
"wide",
"free",
"open",
"poor",
"rich",
"next",
"real",
"long",
"huge",
"wild",
"sick",
"weak",
"firm",
"pink",
"okay",
"dull",
"loud",
"lazy",
"dumb",
"tidy",
"idle",
"bony",
"cute",
"oily",
"lame",
"mega",
"limp",
"wavy",
"edgy",
"nosy",
"zany",
"base",
"cold",
}
var logoString = retrieveLogo()
// GenerateNodeName - generates a random node name
func GenerateNodeName() string {
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
return SMALL_NAMES[rng.Intn(len(SMALL_NAMES))] + "-" + NAMES[rng.Intn(len(NAMES))]
seed := time.Now().UTC().UnixNano()
nameGenerator := namegenerator.NewNameGenerator(seed)
return nameGenerator.Generate()
}
// RetrieveLogo - retrieves the ascii art logo for Netmaker